Azure Blob Storage "Authorization Permission Mismatch" Error

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:

  1. Go to Storage account > IAM > Add role assignment.
  2. In 'Add Role Assignment', select these two roles
    • Storage Blob Data Contributor
    • Storage Queue Data Contributor
  3. Assign it to your account.
  4. These should reflect on your storage account (green highlight)

service

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

https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-javascript-get-started?tabs=account-key


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