When the same command from the terminal using the same login account, runs without error. If I use the same command in a bash script, then I get this error message. The Document reference doesn't include an example for role assignment for a management group. Could we add an example here please?
Any clue why this is failing?
Command Run: az role assignment create --assignee-object-id $sp_id --assignee-principal-type "ServicePrincipal" --role "Owner" --scope $mgmt_id
Error Message : The request did not have a subscription or a valid tenant level resource provider.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
When the same command from the terminal using the same login account, runs without error. If I use the same command in a bash script, then I get this error message. The Document reference doesn't include an example for role assignment for a management group. Could we add an example here please?
Any clue why this is failing?
Command Run:
az role assignment create --assignee-object-id $sp_id --assignee-principal-type "ServicePrincipal" --role "Owner" --scope $mgmt_idError Message : The request did not have a subscription or a valid tenant level resource provider.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.