Skip to content

Unable to create child management group as of version 2.27.1 #19511

Description

@mdtro

Describe the bug

$ az account management-group create --name "test123" --parent "MyTestMG"

In version 2.27.0, creating a child management group. As of 2.27.1, the same command is failing with the error message:

(AuthorizationFailed) The client '<spn id>' with object id '<spn id>' does not have authorization to perform action 'Microsoft.Management/register/action' over scope '/subscriptions/<subscription id>' or the scope is invalid. If access was recently granted, please refresh your credentials.

To Reproduce

To recreate this issue, you'll need the following:

  • A management group, for example named "MyTestMG".
  • A subscription (does not need to be a member of the above management group).
  • A SPN with the following roles assigned:
    • Reader at the subscription scope.
    • Management Group Contributor at the "MyTestMG" management group scope.
  • An AzureCLI (version >=2.27.1) shell logged in as your SPN.
  • An Azure PowerShell instance logged in as your SPN.

Running the following will fail with an error message.

$ az account management-group create --name "test123" --parent "MyTestMG"

(AuthorizationFailed) The client '<spn id>' with object id '<spn id>' does not have authorization to perform action 'Microsoft.Management/register/action' over scope '/subscriptions/<subscription id>' or the scope is invalid. If access was recently granted, please refresh your credentials.

In Azure PowerShell (I tested with version 6.4.0.34709), the equivalent command with the same SPN and assigned roles will complete successfully and create the child management group.

$parentGroup = Get-AzManagementGroup -GroupName MyTestMG
New-AzManagementGroup -GroupName 'test123' -ParentId $parentGroup.id

Expected behavior
With both AzureCLI and Azure PowerShell, I would expect them to behave the same way and create the child management group with the same roles/permissions assigned to the SPN.

Environment summary
AzureCLI >=2.27.1
Azure PowerShell 6.4.0.34709

Azure environment:

  • A management group, for example named "MyTestMG".
  • A subscription (does not need to be a member of the above management group).
  • A SPN with the following roles assigned:
    • Reader at the subscription scope.
    • Management Group Contributor at the "MyTestMG" management group scope.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Accountaz login/accountService AttentionThis issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions