Storage account 403 errors
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Day-to-day operations
-
Phase 3: Enterprise architecture
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
An Azure storage 403 error means the storage service got your request and turned it down. It looks like one problem but it’s at least four: the network rules said no, your identity has no data role, your SAS token is wrong or has expired, or the account won’t accept the kind of key you used.
Luckily, Azure tells you which one it is in the error code, since AuthorizationPermissionMismatch, AuthorizationFailure and AuthenticationFailed each point at a different layer. Most people only read “403 Forbidden” and start changing things at random.
In the lab you’ll create a storage account, cause the three most common 403s on purpose, and fix each one by reading its error code.
| Time | You need | Cost | By the end you can |
|---|---|---|---|
| About 40 minutes | A free account, the CLI and PowerShell | Less than 1 US cent: an empty storage account and a handful of requests | Decode storage 403 errors from the error code, and fix RBAC, firewall and SAS causes |
What it is, in one line
A storage 403 means your request got to Azure Storage and was refused, and the error code tells you whether the network, RBAC, SAS or key settings did the refusing.
In Simple Words
The locker room with three guards
Picture a gym locker room with three guards. The first checks you came in through the right gate (network rules), the second checks that your membership card covers the locker room (your role), and the third checks that the day pass you were handed hasn’t expired (SAS token).
Each guard says no in a different way: “Wrong entrance”, “Your plan doesn’t include lockers” or “This pass expired yesterday”. If all you hear is “No”, you might go and renew your membership when the real problem was the gate. Azure Storage’s guards say no with different error codes, so once you read the code you know which guard stopped you.
Engineer's View
Decoding storage 403s
- AuthorizationPermissionMismatch: you signed in with Microsoft Entra ID (
--auth-mode login, or a managed identity) but you don’t have a data role like Storage Blob Data Reader or Contributor. Being Owner or Contributor on the account isn’t enough. - AuthorizationFailure: the storage firewall stopped you, because public network access is restricted and your IP or subnet isn’t on the list, or a private endpoint is required.
- AuthenticationFailed: the signature doesn’t check out. It could be a SAS that’s expired or not valid yet, a SAS with the wrong permissions or resource, a revoked user delegation key, or a large clock difference.
- KeyBasedAuthenticationNotPermitted: shared key access is turned off on the account, so account keys and account SAS get refused.
- Where to see them: in the CLI or SDK error, in the HTTP response body (XML with Code and AuthenticationErrorDetail), and in StorageBlobLogs if you’ve switched on diagnostic settings.
- Propagation: new role assignments can take a few minutes to kick in, and firewall rule changes can take a few minutes as well.
How it works, step by step
Here’s what happens when you list blobs with --auth-mode login:
- The CLI gets a storage token from Microsoft Entra ID.
- The request arrives at the storage account’s public endpoint.
- The firewall checks your source IP or subnet, and if public access is restricted and you’re not allowed, you get 403 AuthorizationFailure.
- Storage then checks your token’s data permissions on this container, and without a data role you get 403 AuthorizationPermissionMismatch.
- If you pass both, the list comes back.
With a SAS URL, step 4 changes: storage checks the signature, times and permissions inside the URL instead, and anything wrong there comes back as 403 AuthenticationFailed.
Before you run any command, double-check it
Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.
| Error code | Layer | First thing to check |
|---|---|---|
| AuthorizationFailure | Network | Storage firewall and private endpoints |
| AuthorizationPermissionMismatch | RBAC data plane | Storage Blob Data role at the right scope |
| AuthenticationFailed | SAS or key signature | Expiry, start time, permissions, clock |
| KeyBasedAuthenticationNotPermitted | Account setting | Shared key access disabled |
See every 403, not just your own
Your own error message only tells you about your own request. If you want to see what’s failing for apps, partners and backup software, send the blob service logs to Log Analytics, and note that the diagnostic setting goes on the blob service, not the account:
'[{"category":"StorageRead","enabled":true},{"category":"StorageWrite","enabled":true},{"category":"StorageDelete","enabled":true}]' | Set-Content C:\azure-lab\bloblogs.json
az monitor diagnostic-settings create --name blob-to-law --resource "$stId/blobServices/default" --workspace $lawId --logs '@C:\azure-lab\bloblogs.json' -o noneAfter that, a single query shows you who’s being refused and why:
StorageBlobLogs
| where TimeGenerated > ago(1d) and StatusCode == 403
| summarize requests = count() by StatusText, CallerIpAddress, AuthenticationType
| order by requests descStatusText holds the same error codes you saw above. AuthenticationType tells you whether the caller used OAuth (Entra ID), SAS or an account key, and CallerIpAddress shows where the request came from. Put this query behind a log search alert (Lesson 34) and you’ll see a new 403 pattern the same day, instead of the next time someone complains.
Trigger and decode the common storage 403s
1A storage account and the first 403
Create an account and a container, then try listing it using your Entra ID login:
$sfx = Get-Random -Minimum 10000 -Maximum 99999
$st = "stl64$sfx"
az group create --name rg-saat-l64 --location centralindia --tags course=saatvedha-azure lesson=64 -o none
az storage account create --resource-group rg-saat-l64 --name $st --sku Standard_LRS --min-tls-version TLS1_2 --allow-blob-public-access false -o none
az storage container create --account-name $st --name lab --auth-mode login -o noneYou’ll hit an error like this:
You do not have the required permissions needed to perform this operation.
Depending on your operation, you may need to be assigned one of the following roles:
"Storage Blob Data Owner"
"Storage Blob Data Contributor"
"Storage Blob Data Reader"
...
If you want to use the old authentication method and allow querying for the right account key, please use the "--auth-mode" parameter and "key" value.This is the CLI’s friendlier wording of AuthorizationPermissionMismatch. You created the account, so you’re its Owner, but Owner is a management role, and reading or writing blobs needs a data role.
2Give yourself a data role
Assign yourself Storage Blob Data Contributor on the account, wait two minutes and try again:
$stId = az storage account show --resource-group rg-saat-l64 --name $st --query id -o tsv
$me = az ad signed-in-user show --query id -o tsv
az role assignment create --assignee-object-id $me --assignee-principal-type User --role "Storage Blob Data Contributor" --scope $stId -o none
az storage container create --account-name $st --name lab --auth-mode login -o none
az storage blob upload --account-name $st --container-name lab --name hello.txt --data "hello from lesson 64" --auth-mode login -o none
az storage blob list --account-name $st --container-name lab --auth-mode login --query "[].name" -o tsvYou should see:
hello.txt

✅ Checkpoint: You can create containers and upload blobs using your Entra ID login, and you’ve seen what a missing data role looks like.
Break It, Then Fix It
Hang on to the storage account, since both breaks use it.
1Break it: the firewall locks you out
A security baseline sets the storage firewall to deny by default:
az storage account update --resource-group rg-saat-l64 --name $st --default-action Deny -o none
az storage blob list --account-name $st --container-name lab --auth-mode login --query "[].name" -o tsvGive it a minute and you should see something like this:
This request is not authorized to perform this operation.
RequestId:...
ErrorCode:AuthorizationFailureIt’s the same identity, the same role and the same command, but the error code is different. AuthorizationFailure points at the network layer rather than permissions, so piling on more roles wouldn’t change anything.
Check the network rules, add your current public IP, wait a minute and try again:
az storage account show --resource-group rg-saat-l64 --name $st --query "networkRuleSet.{default:defaultAction, ips:ipRules[].ipAddressOrRange, vnets:virtualNetworkRules[].virtualNetworkResourceId}" -o json
$myIp = (Invoke-RestMethod https://api.ipify.org)
az storage account network-rule add --resource-group rg-saat-l64 --account-name $st --ip-address $myIp -o none
az storage blob list --account-name $st --container-name lab --auth-mode login --query "[].name" -o tsvhello.txt shows up in the list again. In production, servers usually come in through service endpoints or private endpoints (Lessons 26 and 65) and people through a VPN or Bastion, not through personal IPs.
There’s a trap here that catches a lot of teams. When a VM reaches storage over a service endpoint, the request arrives with the VM’s private IP and not its public one, so an IP rule for the VM’s public address never matches and the VM keeps getting AuthorizationFailure.
For traffic from a VNet, add a virtual network rule for the subnet, and keep IP rules for traffic that comes from the internet. Requests from Azure services in the same region take different paths again, which is why private endpoints are the cleanest option for servers.
2Break it: a SAS link that stopped working
A partner is given a short-lived read link. Create a user delegation SAS that expires in 2 minutes and test it:
$exp = (Get-Date).ToUniversalTime().AddMinutes(2).ToString('yyyy-MM-ddTHH:mmZ')
$uri = az storage blob generate-sas --account-name $st --container-name lab --name hello.txt --permissions r --expiry $exp --auth-mode login --as-user --full-uri -o tsv
curl.exe -s $uriYou should see hello from lesson 64. Now wait 3 minutes and run the same request again:
curl.exe -s $uriYou should see something like this:
<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:...
Time:2026-10-21T06:14:09.1234567Z</Message><AuthenticationErrorDetail>Signature not valid in the specified time frame: Start [Tue, 21 Oct 2026 06:05:31 GMT] - Expiry [Tue, 21 Oct 2026 06:12:00 GMT] - Current [Tue, 21 Oct 2026 06:14:09 GMT]</AuthenticationErrorDetail></Error>AuthenticationFailed tells you the signature itself isn’t valid any more, and the AuthenticationErrorDetail element gives the reason, which here is the expiry time. Notice the request still came from your allowed IP, because a SAS doesn’t get you past the firewall.
To fix it, issue a new SAS with an expiry that fits what the partner needs, and keep it as short as you can:
$exp = (Get-Date).ToUniversalTime().AddHours(4).ToString('yyyy-MM-ddTHH:mmZ')
$uri = az storage blob generate-sas --account-name $st --container-name lab --name hello.txt --permissions r --expiry $exp --auth-mode login --as-user --full-uri -o tsv
curl.exe -s $urihello from lesson 64 should come back again.

3Clean up
Delete the lab resource group:
az group delete --name rg-saat-l64 --yes✅ Checkpoint: You fixed a missing data role, a firewall block and an expired SAS, each one from its own error code.
This happened at work
The backup job that failed every Sunday
A media company’s backup software wrote to an Azure storage account every night. It ran fine Monday to Saturday and then failed every Sunday with 403 errors, and the backup team blamed the software while the cloud team insisted nothing was wrong with the account.
StorageBlobLogs settled it. The Sunday requests came from a different public IP, because the full backup ran on a second media server sitting behind another internet link, and that IP had never been added to the storage firewall, so it got AuthorizationFailure. The Monday-to-Saturday incrementals all came from the first server.
What they changed: both media servers now reach the account through a private endpoint over their ExpressRoute link, public access is off, and a log search alert fires on any 403 in StorageBlobLogs, grouped by caller IP and error code, so the next mismatch shows up the same day.
Common mistakes and troubleshooting
| Mistake | What you see | What to do |
|---|---|---|
| Expecting Owner to read blobs | AuthorizationPermissionMismatch | Assign a Storage Blob Data role. |
| Adding roles for a firewall block | AuthorizationFailure stays | Fix the network rules or use a private endpoint. |
| SAS without enough time or permissions | AuthenticationFailed | Read AuthenticationErrorDetail, then reissue the SAS. |
| Using keys when shared key is disabled | KeyBasedAuthenticationNotPermitted | Use Entra ID or a user delegation SAS. |
| Testing right after a change | Old error still returned | Give roles and rules a few minutes to apply. |
| No storage logs | Can’t see who got 403 | Send StorageBlobLogs to Log Analytics. |
Interview questions
Click a question to open it. Each one is phrased the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.
Fresher level
1. What does a 403 from Azure Storage mean?
Why they ask this: The basic concept.
How you might answer: It means the request reached the service and got refused, whether because of network rules, permissions, a bad signature or account settings.
2. Why can an Owner not read blobs with Entra ID?
Why they ask this: A classic question.
How you might answer: Owner is a management-plane role. To touch the data you need a data role, like Storage Blob Data Reader or Contributor.
3. What is a user delegation SAS?
Why they ask this: Security vocabulary.
How you might answer: It’s a SAS signed with a key you get through Entra ID rather than the account key, so you can revoke and audit it, and it still works when shared keys are disabled.
2–5 years experience
4. How do you troubleshoot a storage 403?
Why they ask this: A real troubleshooting path.
How you might answer: I’d read the error code first. AuthorizationFailure is the network, AuthorizationPermissionMismatch is RBAC and AuthenticationFailed is the signature. Then I’d check that layer, and look in StorageBlobLogs for the caller IP and auth type.
5. A VM in a VNet gets AuthorizationFailure. What do you check?
Why they ask this: Network depth.
How you might answer: I’d check the storage firewall rules for the subnet (service endpoint) or the private endpoint, make sure DNS resolves to the private IP, and confirm the traffic is leaving by the path I expect.
6. How would you find all 403s in the last day?
Why they ask this: Logs skill.
How you might answer: I’d query StorageBlobLogs for StatusCode 403 and summarise by StatusText, CallerIpAddress and AuthenticationType.
Senior level
7. How would you secure a storage account for production?
Why they ask this: They want a baseline.
How you might answer: Turn off or restrict public access, use private endpoints, disable shared key access, use Entra ID with least-privilege data roles and only user delegation SAS, keep diagnostic logs, and enforce the lot with Azure Policy.
8. Why disable shared key access?
Why they ask this: Security reasoning.
How you might answer: Account keys give full access and aren’t tied to anyone’s identity. Turning them off forces Entra ID, which you can scope, audit and protect with Conditional Access.
9. How do you migrate apps away from account keys?
Why they ask this: Migration thinking.
How you might answer: I’d use the logs to find where keys are being used, move those apps to managed identities and data roles, and swap account SAS for user delegation SAS. Then I’d disable shared key access and watch for KeyBasedAuthenticationNotPermitted.
Quick quiz
Q1. Owner on the account, 403 AuthorizationPermissionMismatch. Fix?
- Add your IP
- Assign a Storage Blob Data role
- Regenerate keys
- New SAS
Show answer
B — Data access needs a data role.
Q2. 403 AuthorizationFailure points to?
- RBAC
- The storage firewall
- SAS expiry
- Shared key setting
Show answer
B — The network rules refused the request.
Q3. Expired SAS returns which code?
- AuthorizationFailure
- AuthenticationFailed
- NotFound
- Conflict
Show answer
B — The signature is no longer valid.
Q4. Does a valid SAS bypass the storage firewall?
- Yes
- No
- Only for reads
- Only with HTTPS
Show answer
B — Network rules still apply.
Q5. Shared key access disabled; account SAS fails with?
- AuthorizationFailure
- KeyBasedAuthenticationNotPermitted
- InvalidUri
- Throttled
Show answer
B — Keys and account SAS are refused.
Quick recap
You can now decode any storage 403 and go straight to the layer that turned it down.
- Read the error code before you change anything.
- AuthorizationFailure is the network, so fix the firewall or use a private endpoint.
- AuthorizationPermissionMismatch is RBAC, so add a data role.
- AuthenticationFailed is the signature, so check the SAS details.
- Switch on StorageBlobLogs to see every 403.
Next lesson
Lesson 65: Private endpoint DNS problems → You fix private endpoints that resolve to the public IP, the DNS problem behind most private endpoint tickets.
Further reading: Azure storage 403 error
Want to go deeper into Azure storage 403 error? See Microsoft’s Troubleshoot 403 errors in Azure Blob Storage and Azure Storage firewall rules. You can also see the full plan for this course on the Azure Cloud Administration course page.
