az role assignment create fails
See original GitHub issueaz role assignment create --debug --assignee XXX-XXX-XXX-XXX-XXX --role XXX-XXX-XXX-XXX-XXX --resource-group rgname
fails with The request was incorrectly formatted.
msrest.http_logger : Request body:
msrest.http_logger : {"properties": {"roleDefinitionId": "XXX-XXX-XXX-XXX-XXX", "principalId": "XXX-XXX-XXX-XXX-XXX"}}
requests.packages.urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
requests.packages.urllib3.connectionpool : https://management.azure.com:443 "PUT /subscriptions/XXX-XXX-XXX-XXX-XXX/resourceGroups/XXX/providers/Microsoft.Authorization/roleAssignments/XXX-XXX-XXX-XXX-XXX?api-version=2015-07-01 HTTP/1.1" 400 88
msrest.http_logger : Response status: 400
msrest.http_logger : Response content:
msrest.http_logger : b'{"error":{"code":"BadRequestFormat","message":"The request was incorrectly formatted."}}'
msrest.exceptions : The request was incorrectly formatted.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Top Results From Across the Web
az role assignment creating fails on role definitions which are ...
Describe the bug. Command Name az role assignment create. Errors: list index out of range Traceback (most recent call last): cli ...
Read more >When I run az ad sp create-for-rbac --sdk-auth > my.azureauth ...
WARNING: In a future release, this command will NOT create a 'Contributor' role assignment by default. If needed, use the --role argument to ......
Read more >Preparing to Deploy Ops Manager on Azure
If logging in to AzureChinaCloud fails with a CERT_UNTRUSTED , use the ... az role assignment create --assignee "SERVICE-PRINCIPAL-NAME" ...
Read more >azure-cli 2.22.1 - PyPI
[BREAKING CHANGE] az synapse role assignment create : When –assignee argument can't uniquely determine the principal object, the command will raise error ...
Read more >Azure Managed ID - How to assign Multiple RBAC Roles via ...
az deployment group create ` --resource-group $RESOURCE_GROUP ... If you want to create multiple assignment at the same time, you could use ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Issue Resolved on my end.
I was trying to give the role to the storage in the bicep.
var storageBlobDataContributorRoleID = 'ba92f5b4-2d11-453d-a403-e96b0029c9fe'
I was writing this property as :
roleDefinitionId: storageBlobDataContributorRoleID
it failedThen I tried this one:
roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', storageBlobDataContributorRoleID)
It worked perfectly.
@asc-adean are you still experiencing this issue?
I believe it will function correctly if you provide your
role_definition_id
in the following format: