Skip to content
Least Privilege Principle

Least privilege for Azure Storage means a data role at container scope, with Shared Key off

Azure Storage separates management roles from data roles. Microsoft's documentation, read 16 Nov 2026, says data access needs a data role such as Storage Blob Data Reader, which can be scoped to one container and narrowed further with role assignment conditions.

Open the calculator ยท All services

Azure Storage authorizes blob data through data roles, not management roles

Microsoft's documentation says only roles explicitly defined for data access permit a security principal to read blob data through Microsoft Entra ID. Built-in roles such as Owner, Contributor and Storage Account Contributor manage a storage account but do not grant blob data access by themselves.

There is one exception that matters for least privilege. Microsoft's documentation says a role that includes Microsoft.Storage/storageAccounts/listKeys/action can still reach the data, because the account key opens it through Shared Key authorization.

Role assignments can be placed at five levels: a single container, the storage account, the resource group, the subscription and a management group. Microsoft says always to grant the narrowest possible scope, and that roles at broader scopes are inherited by everything beneath them.

The identities that call this service (people, services, workloads, third parties) are covered in the Azure service identities guide and the workload identities guide.

Roles and settings to avoid, with the documented reason

Four choices widen access more than most tasks need.

  • Storage Account Contributor: Microsoft's role description says it provides access to the account key, which can be used to access data via Shared Key authorization.
  • Storage Blob Data Owner: Microsoft describes it as full access to blob containers and data, including assigning POSIX access control. Use it only where ownership or POSIX control is the job.
  • Storage Blob Data Contributor at account, resource group or subscription scope: it reads, writes and deletes, and the scope decides how many containers that covers.
  • Shared Key authorization: Microsoft's documentation says it is not recommended because it may be less secure, and advises disabling it for the storage account.

A minimal binding for read-only access to one container

For a reporting job that reads files from a single container, assign the Storage Blob Data Reader role at the container scope. The role ID and permissions below come from Microsoft's built-in role listing.

ItemValue
RoleStorage Blob Data Reader
Role ID2a2b9908-6ea1-4ae2-8e65-a410df84e7d1
Management actionsMicrosoft.Storage/storageAccounts/blobServices/containers/read; Microsoft.Storage/storageAccounts/blobServices/generateUserDelegationKey/action
Data actionMicrosoft.Storage/storageAccounts/blobServices/containers/blobs/read
ScopeThe one container, not the account

Storage's own controls narrow access further

Role assignment conditions add an attribute check to a data role. Microsoft's documentation says conditions can be added to built-in roles including Storage Blob Data Reader, Contributor and Owner, and that they are evaluated when the action is authorized.

Microsoft gives one example: read access to blobs only if the blobs are tagged Project=Sierra. It also states the trade-off: conditions need a consistent attribute taxonomy, and the attributes must be protected so that access is not compromised.

Conditions are not supported for management actions through the Storage resource provider. For shared access signatures, Microsoft recommends a user delegation SAS, secured with Microsoft Entra credentials rather than the account key. The Storage Blob Delegator role is the one that grants the delegation key.

Checking what is used

Microsoft Defender for Cloud permissions management, per Microsoft's documentation, continuously analyzes identity configurations and usage patterns to identify excessive, unused or misconfigured permissions, including for managed identities and service principals. Microsoft Entra access reviews can be scheduled weekly, monthly, quarterly or annually so that owners confirm or remove role assignments.

Microsoft's role-based access control best practices also say to limit subscription owners to a maximum of 3 and to avoid privileged administrator roles when a job function role fits. For storage, list role assignments on the account and ask of each one whether the holder reads, writes or deletes, and at which container.

Sources

  1. Azure built-in roles for storage, read 16 Nov 2026
  2. Authorize access to blob data with Microsoft Entra ID, read 16 Nov 2026
  3. Azure role assignment conditions for Blob Storage, read 16 Nov 2026
  4. Azure RBAC best practices, read 16 Nov 2026
  5. Defender for Cloud permissions management, read 16 Nov 2026
  6. Microsoft Entra access reviews, read 16 Nov 2026

Last reviewed 16 Nov 2026.