A 403 AuthorizationFailure from Azure Storage is a precise signal that gets misread constantly: the request was authenticated fine, and the account still refused it. Teams burn hours rotating keys and regenerating SAS tokens when the actual blocker is a network rule, a missing data plane role, or an account setting that forbids the credential type in use. The response body’s error code and the account’s diagnostic logs will name the layer if you look at them before changing anything.
403 AuthorizationFailure (Azure Storage)
What this error means
Every request to a storage account passes through layered checks: network rules first (public access setting, firewall IP rules, virtual network rules, private endpoints), then authorization (account key, SAS token permissions and expiry, or Azure AD RBAC data roles), plus account level switches such as allowSharedKeyAccess and allowBlobPublicAccess. The specific error code in the XML response body identifies the failed layer: AuthorizationFailure most commonly means network rules blocked the caller, AuthorizationPermissionMismatch means the identity lacks the data role for the operation, AuthorizationSourceIPMismatch means a SAS IP restriction failed, and KeyBasedAuthenticationNotPermitted means shared key access is disabled on the account.
Common causes
- The account firewall is set to selected networks and the caller’s IP or subnet is not on the list, including build agents, Functions, and services with dynamic outbound IPs.
- The account uses private endpoints and public network access is disabled, while the caller resolves the public endpoint because private DNS is not configured on its network.
- The identity authenticates with Azure AD but holds only management roles (Owner, Contributor) and no Storage Blob Data role.
- A SAS token missing the required permission, pointed at the wrong resource type, expired, or invalidated by a key rotation.
- Shared key access disabled on the account (
allowSharedKeyAccess false) while the client still authenticates with the account key or a key derived SAS. - The trusted Microsoft services bypass is off, blocking Azure services that reach the account through the firewall exception path.
How to fix it
STABILIZE first. If production is blocked and a recent change to network rules or account settings correlates, revert that change; storage firewall edits apply quickly, so restoring the previous rules restores access.
- DIAGNOSE the exact error code. Reproduce the call and read the response body, not just the status:
az storage blob list \
--account-name mystorageacct \
--container-name data \
--auth-mode login \
--debug
- Check the network rules and account settings that generate AuthorizationFailure:
az storage account show \
--name mystorageacct --resource-group rg \
--query '{PublicAccess:publicNetworkAccess,DefaultAction:networkRuleSet.defaultAction,IPRules:networkRuleSet.ipRules,VnetRules:networkRuleSet.virtualNetworkRules,Bypass:networkRuleSet.bypass,SharedKey:allowSharedKeyAccess}'
A defaultAction of Deny with the caller absent from the rules is the classic cause. Compare against the caller’s real egress IP, which for PaaS services is rarely the address you assume.
- FIX the network layer to match the intended path. Add the caller’s subnet or IP if the public endpoint with a firewall is the design:
az storage account network-rule add \
--account-name mystorageacct --resource-group rg \
--vnet-name app-vnet --subnet app-subnet
If private endpoints are the design, fix DNS instead of opening the firewall: the caller’s network must resolve mystorageacct.blob.core.windows.net to the private endpoint IP through the privatelink.blob.core.windows.net zone. Verify with nslookup from the caller; a public IP in the answer means the private DNS zone is not linked to that VNet.
- FIX the identity layer if the code is
AuthorizationPermissionMismatch. Grant the data plane role at the narrowest useful scope and wait a few minutes for propagation:
az role assignment create \
--assignee <principal-id> \
--role "Storage Blob Data Contributor" \
--scope /subscriptions/<sub-id>/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/mystorageacct
- If key based auth is blocked by policy, move the client to Azure AD auth (managed identity plus a data role) rather than re enabling shared keys, which is usually disabled deliberately.
How to prevent it
- Enable diagnostic logging on the account so every 403 is recorded with its error code, caller IP, and auth type.
- Manage storage network rules and role assignments as code, so an audit trail exists for every access change.
- Standardize on managed identities with data plane roles instead of account keys and long lived SAS tokens.
- Test connectivity from the actual runtime environment (the App Service console, the build agent) after any network change, not just from a laptop.
- Document the intended access path per account (public with firewall, or private endpoint) so DNS and rules are checked against a known design.
When to call a senior engineer
Call for help when access works from some networks and inexplicably fails from others, when private endpoint DNS spans hub and spoke VNets nobody fully maps, or when unblocking production keeps tempting the team to set the firewall to allow all. Erzon engineers can trace the request path from caller to account through every rule that touches it, restore access without weakening the security posture, and leave the account with logging that makes the next 403 self explanatory.
Related errors we fix
Want a senior engineer to just fix it?
Paste this exact error into the form. A senior engineer replies within one business hour with what is likely wrong and a flat quote. Triage is free.
Book a fix