I am trying to give an AD user an IAM access (Storage Blob Data Reader) to a Container by REST Api call.
My storage structure is like:- Subscription >> ResourceGroup >> Resource(i.e. a storage account) >>
Many Containers >> Some blobs under each container
Am able to provide Reader access for an user (who is in my Active Directory) to the StorageAccount Level through REST call using :-
https://management.azure.com/subscriptions/SUBSCRIPTION-ID/resourceGroups/RESOURCE-GROUP-NAME/providers/Microsoft.Storage/storageAccounts/STORAGE-ACCOUNT-NAME/providers/Microsoft.Authorization/roleAssignments/ANY-UNIQUE-GUID?api-version=2015-07-01
HEADER:
[{"key":"Content-Type","value":"application/json"}]
[{"key":"Authorization","value":"Bearer Token"}]
BODY:
{
"properties": {
"roleDefinitionId": "/subscriptions/SUBSCRIPTION-ID/resourceGroups/RESOURCE-GROUP-NAME/providers/Microsoft.Storage/storageAccounts/STORAGE-ACCOUNT-NAME/providers/Microsoft.Authorization/roleDefinitions/READER-ACCESS-GUID",
"principalId": "AD-USER-OBJECT-ID"
}
}
Please help me to assign a role for that user at any particular container (not all) level under the storage account, as well, so that he/she can read/write any blob inside that container.
Thank you!
In Postman it returns status Code 201 and number of role assignment is shown increased by 1 in azure portal, but the user can not see any blob inside that Container.
Please help or let me know if you need any more info.
subscriptions/<subscription id>/resourceGroups/<group name>/providers/Microsoft.Storage/storageAccounts/<account name>/blobServices/default/containers/<container name>
– Jim Xu