Skip to content

Set-AzRoleDefinition fails to update if Assignable Scope is changed to new Management Group #13449

Open
@scottstout

Description

@scottstout

Description

If you do the Set-AzRoleDefinition it will fail if you change the scope from one Management Group to another. It will say it can't find a role definition by that ID. It appears to be relying on the assignable scope to look for the ID and the role isn't currently in the new assignable scope you are trying to update to.

Note that this works fine in Azure CLI.

Steps to reproduce

Try to reproduce the scenario described here. In particular we are trying to reproduce the approach described as "Change the assignable scope within the role definition. In the above example, you can update the assignable scopes from Marketing to Root Management Group so that the definition can be reached by both branches of the hierarchy."

  1. Create custom role with an assignable scope set to a custom MG.
  2. Get the role definition and modify the assignable scope to be the tenant root assignable scope.
  3. Run Set-AzRoleDefinition to update the role definition to the new scope. This will fail with a message saying it can't find a role definition with the specified ID.

Environment data


Module versions

Debug output


Error output


Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions