Error message when you try to connect your code to Azure Blob Storage
errorCode: 'AuthorizationPermissionMismatch',
'content-length': '279',
'content-type': 'application/xml',
server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0',
Solution:
- Go to Storage account > IAM > Add role assignment.
- In 'Add Role Assignment', select these two roles
- Storage Blob Data Contributor
- Storage Queue Data Contributor
- Assign it to your account.
- These should reflect on your storage account (green highlight)
Additional Note
There is a recommended set up also in every programming language in this documentation before you connect your code. In this sample, I choose JS
Here is the write up from the documentation:
Set up storage account roles
Your storage resource needs to have one or more of the following Azure RBAC roles assigned to the identity resource you plan to connect with. Setup the Azure Storage roles for each identity you created in the previous step: Azure cloud, local development, on-premises.
After you complete the setup, each identity needs at least one of the appropriate roles:
- A data access role - such as:
- Storage Blob Data Reader
- Storage Blob Data Contributor
- A resource role - such as:
- Reader
- Contributor