Skip to content

Not able to list polices on management group #9067

@murarisumit

Description

@murarisumit

Describe the bug
Not able to list polices on management group.

az policy assignment list \
--disable-scope-strict-match \
--scope "/providers/Microsoft.Management/managementGroups/my-mg-group" 
--query [].name

To Reproduce

Steps to reproduce the behavior.

  1. Create a policy
 az policy definition create \
   --management-group my-mg-group
   --name 'sumit-enforce-nsg-on-subnett' \
   --display-name 'Sumit- NSG X on every subnet' \
   --description 'This policy enforces a specific NSG on every subnet' \
   --rules <azurepolicy.rules.json> \
   --params <azurepolicy.parameters.json> \
   --mode All 
  1. Assign the policy to management group.
az policy assignment create \
  --name "Force nsg in subnet" \
  --scope "/providers/Microsoft.Management/managementGroups/my-mg-group" \
  --policy "/providers/Microsoft.Management/managementgroups/my-mg-group/providers/Microsoft.Authorization/policyDefinitions/sumit-enforce-nsg-on-subnett" \
  -p '{"nsgId": { "value":"sumit-test-vm-nsg"}}'

below command should work, but not working for me.

az policy assignment list \
--disable-scope-strict-match \
--scope "/providers/Microsoft.Management/managementGroups/my-mg-group" 
--query [].name

Expected behavior
I should be able to list the assigned polices in management group

Environment summary

Install : pip
CLI version: azure-cli 2.0.60 *
OS version: macOS Mojave 10.14.4
Shell type: bash

Additional context
Add any other context about the problem here.

Metadata

Metadata

Labels

ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupResource Manager-cliService AttentionThis issue is responsible by Azure service team.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions