Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query governance policies attached to a Management Group #25857

Closed
sdsubhajitdas opened this issue May 12, 2023 · 4 comments
Closed

Query governance policies attached to a Management Group #25857

sdsubhajitdas opened this issue May 12, 2023 · 4 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. Policy question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@sdsubhajitdas
Copy link

Is your feature request related to a problem? Please describe.

I am trying to list out all the governance policies that are attached to a particular Azure Management Group.
I am using the @azure/arm-policy npm module to get the details.

The below snippet is a gist of what I am trying to achieve.

const azureArmPolicy = require("@azure/arm-policy");

const client = new azureArmPolicy.PolicyClient(<credentials>,<subscription_id>);

client.policyAssignments.listForManagementGroup(<management_group_id>, (err, data) => {
  console.error(err);
  console.log(data);
});

I am using the listForManagementGroup method which will give me all the governance policies that are attached to a particular management group.

The issue that I am facing is, for my use case I don't have access to the <subscription_id> and to get the governance policies I need to create a PolicyClient object which requires <subscription_id>.

Describe the solution you'd like

Is there any other method or any other npm package which I can use to get the governance policies without the usage of <subscription_id> at any step?

Describe alternatives you've considered
I went through this guide https://learn.microsoft.com/en-us/azure/governance/policy/assign-policy-javascript provided by Azure but I still need to use <subscription_id>.

Additional context
NodeJs - 18
@azure/arm-policy - 4.2.0

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 12, 2023
@xirzec xirzec added Mgmt This issue is related to a management-plane library. Policy labels May 12, 2023
@github-actions github-actions bot removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label May 12, 2023
@qiaozha
Copy link
Member

qiaozha commented May 15, 2023

@kazrael2119 Could you help take a look if make the subscriptionId optional works and file a PR to release a new version ?

@kazrael2119
Copy link
Contributor

kazrael2119 commented May 24, 2023

@sdsubhajitdas ,we release a new version to fix it, https://www.npmjs.com/package/@azure/arm-policy/v/5.1.0 ,could you try it ?

@lirenhe lirenhe added the needs-author-feedback Workflow: More information is needed from author to address the issue. label May 26, 2023
@github-actions
Copy link

Hi @sdsubhajitdas. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

@github-actions
Copy link

github-actions bot commented Jun 2, 2023

Hi @sdsubhajitdas, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@github-actions github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Jun 2, 2023
minhanh-phan pushed a commit to minhanh-phan/azure-sdk-for-js that referenced this issue Jun 12, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 17, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Sep 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Mgmt This issue is related to a management-plane library. needs-author-feedback Workflow: More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue. Policy question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

5 participants