Search code examples
azureazure-cliazure-storage-account

Azure Storage blob delete cache permission issue


I have an Azure account with Owner permission for the subscription we have. I can see that two permissions existing for the same subscription, One is owner, and the other is Contributor. I am trying to delete the blob cache with the following Azure CLI command:

az storage blob delete-batch --source <containerName> --account-name <storageAccountName> --auth-mode login

I am getting the below error

enter image description here

I am not sure, despite having enough permissions why I am getting this error. Please help

Attaching the permission of my subscription enter image description here

My access permission to storage account enter image description here


Solution

  • If you set the --auth-mode parameter to login, it means that you use Azure AD auth to retrieve Azure blob data. If so, the Azure AD Azure AD security principal you used to login should be assigned to the role Storage Blob Data Owner Storage Blob Data Contributor or Storage Blob Data Reader. Otherwise, you have no permissions to process Azure blob.

    Now, your account just has been assigned to Owner, please set the --auth-mode parameter to key which means that users attempt to retrieve the account access key to use for processing Azure blob. The Owner role has the permissions to do that.

    For more details, please refer to here and here