Open
Description
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."
- Create custom role with an assignable scope set to a custom MG.
- Get the role definition and modify the assignable scope to be the tenant root assignable scope.
- 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