Open 1stewart opened 3 years ago
add to S178
Since conditions aren't well documented, I'm not sure how else to get the format it should be in, so may be user error due to misunderstanding the syntax.
The lack of document has been reported by https://github.com/Azure/azure-cli/issues/15628. The corresponding document will be updated by RBAC service team later.
Describe the bug
az role assignment create --role "Contributor" --assignee-object-id 3d5dab4e-3726-4783-bfa6-6937955da4b0 --condition "@Resource[Microsoft.Storage/storageAccounts/blobServices/containers:Name] stringEquals 'foo'" --condition-version "2.0"
works (from the documentation: https://docs.microsoft.com/en-us/cli/azure/role/assignment?view=azure-cli-latest
az role assignment create --role "Contributor" --assignee-object-id 3d5dab4e-3726-4783-bfa6-6937955da4b0 --condition "@Resource[Microsoft.ServiceBus/namespaces/queues:Name] stringEquals 'foo'" --condition-version "2.0" --debug
doesn't work with the error: BadRequestError: The given role assignment condition is invalid.
I got the resource name based on finding Microsoft.Storage/storageAccounts/blobServices/containers at https://docs.microsoft.com/en-us/azure/templates/microsoft.storage/2018-07-01/storageaccounts/blobservices/containers and working through the ServiceBus documentation to its format. Since conditions aren't well documented, I'm not sure how else to get the format it should be in, so may be user error due to misunderstanding the syntax.
To Reproduce Try and give a role assignment with a condition matching the resource Microsoft.ServiceBus/namespaces/queues
Expected behavior A user role assignment with contributor for queues matching 'foo'
Environment summary install method: brew cli version:
OS version: macOS Catalina 10.15.5
Additional context