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

Azure Policy Rules do not support Management Groups #1304

Open
s4parke opened this issue Mar 29, 2024 · 0 comments
Open

Azure Policy Rules do not support Management Groups #1304

s4parke opened this issue Mar 29, 2024 · 0 comments

Comments

@s4parke
Copy link

s4parke commented Mar 29, 2024

Details of the scenario you tried and the problem that is occurring

When writing an Azure policy that includes applies to a management group, the policy fails.

{
  "mode": "All",
  "policyRule": {
    "if": {
      "field": "type",
      "equals": "microsoft.management/managementgroups"
    },
    "then": {
      "effect": "audit"
    }
  }
}

Expected result (in Policy blade): Management group resources found
Actual result (in Policy blade): No resources found

For example, I want to create a policy to check for a DiagnosticSettings profile on each Management Group to stream Activity Logs to a Workspace. Or maybe I want to create an Activity Log Alert. It is possible to do this for Subscriptions with Azure Policy, but not for Management Groups. There is a built-in version of this policy for Subscriptions and it is possible to write custom policies for a Subscription resource type.

The only way to create, update, list, or view a Management Group's resource providers like DiagnosticSettings and Alerts appears to be via PowerShell or the REST API, which is a problem for organizations trying to use Azure Policy for governance and avoid shadow IT workarounds.

Verbose logs showing the problem

No management groups were audited, so there is nothing in the logs after the assignment.

Suggested solution to the issue

Management Group resources should be manageable like other Azure resources (for example Subscriptions) using Azure Policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant