Home › Studies › AZ-104 › Storage › Storage Access

Storage Access

Access keys · SAS · stored access policies · firewalls and virtual networks · anonymous access

By the tools4free.dev team · Last reviewed November 13, 2026

Practice questions for this topic →

Access keys

Rotation stepAction
1Point apps at key2
2Regenerate key1
3Point apps at the new key1
4Regenerate key2
5Verify the apps

Disallow Shared Key

SAS types

TypeSigned withScopeStored access policy?
User delegation SASEntra credentials (user delegation key)Blob, Data Lake, Queue, Table, Azure Files (the Shared Key page lists Blob Storage only)No
Service SASAccount keyOne storage serviceYes
Account SASAccount keyOne or more services, plus service-level operationsNo

Stored access policies

SAS expiration policy is different. It's an account setting that sets the upper limit on SAS validity (format <days>.<hours>:<minutes>:<seconds>, for example 1.12:05:06). The action is Log (default, audit only) or Block. A signed start field becomes required. Azure File Sync needs at least 3 days.

Firewalls and virtual networks

Anonymous access

LevelAnonymous clients can
Private (default)Nothing
BlobRead a blob if they know its URL; can't list
ContainerList and read

CLI and PowerShell

TaskAzure CLIPowerShell
List keysaz storage account keys list --resource-group <rg> --account-name <n>Get-AzStorageAccountKey -ResourceGroupName <rg> -Name <n>
Regenerate a keyaz storage account keys renew --resource-group <rg> --account-name <n> --key primaryNew-AzStorageAccountKey -ResourceGroupName <rg> -Name <n> -KeyName key1
Disallow Shared Keyaz storage account update --name <n> --resource-group <rg> --allow-shared-key-access falseSet-AzStorageAccount -ResourceGroupName <rg> -AccountName <n> -AllowSharedKeyAccess $false
User delegation SAS (blob)az storage blob generate-sas --account-name <n> --container-name <c> --name <b> --permissions acdrw --expiry <dt> --auth-mode login --as-user --full-uri-
Revoke user delegation keysaz storage account revoke-delegation-keys --name <n> --resource-group <rg>-
Stored access policyaz storage container policy create --container-name <c> --name <p> --permissions <rwdl> --start <dt> --expiry <dt> --account-name <n>-
SAS expiration policyaz storage account update --name <n> --resource-group <rg> --sas-exp 1.12:05:06 --sas-expiration-action BlockSet-AzStorageAccount ... -SasExpirationPeriod 1.12:05:06 -SasExpirationAction Block
Default action Denyaz storage account update -g <rg> -n <n> --default-action DenyUpdate-AzStorageAccountNetworkRuleSet -ResourceGroupName <rg> -Name <n> -DefaultAction Deny
Service endpoint on a subnetaz network vnet subnet update -g <rg> --vnet-name <v> --name <s> --service-endpoints "Microsoft.Storage.Global"Set-AzVirtualNetworkSubnetConfig ... -ServiceEndpoint "Microsoft.Storage.Global", then Set-AzVirtualNetwork
Add a VNet ruleaz storage account network-rule add -g <rg> --account-name <n> --subnet <subnetId>Add-AzStorageAccountNetworkRule -ResourceGroupName <rg> -Name <n> -VirtualNetworkResourceId $subnet.Id
Add an IP ruleaz storage account network-rule add -g <rg> --account-name <n> --ip-address "16.17.18.0/24"Add-AzStorageAccountNetworkRule -ResourceGroupName <rg> -AccountName <n> -IPAddressOrRange "16.17.18.0/24"
Set exceptionsaz storage account update -g <rg> -n <n> --bypass Logging Metrics AzureServicesUpdate-AzStorageAccountNetworkRuleSet -ResourceGroupName <rg> -Name <n> -Bypass AzureServices,Metrics,Logging
Block anonymous accessaz storage account update ... --allow-blob-public-access false-AllowBlobPublicAccess $false
Container access levelaz storage container set-permission --name <c> --account-name <n> --public-access container|blob|off --auth-mode keySet-AzStorageContainerAcl -Container <c> -Permission Container -Context $ctx

Exam Tips

Tick each tip once you can answer it without looking.

“Revoke a service SAS without regenerating account keys” → Delete or modify the stored access policy it references. Trap: regenerating keys works but breaks everything signed with the key.

“Six different SAS scenarios, six stored access policies on one container” → Not possible: the maximum is 5 per container (a sixth returns 400). Trap: unlimited policies.

“Rotate keys without app downtime” → Switch apps to key2, regenerate key1, switch to key1, regenerate key2. Trap: regenerating both at once.

“Let a user view and regenerate keys without full Contributor” → Storage Account Key Operator Service Role. Trap: Storage Blob Data Contributor is data plane only.

“Most secure SAS, no account key” → User delegation SAS (Entra ID). Trap: account SAS.

“Shared Key is disallowed: which SAS still works?” → User delegation SAS. Trap: service SAS and account SAS are key-signed.

“Require Conditional Access for storage requests” → Disallow Shared Key authorization. Trap: firewall rules don't apply Conditional Access.

“Principal must create a user delegation SAS” → A role with generateUserDelegationKey, such as Storage Blob Data Contributor. Trap: Reader has no such action.

“User delegation SAS set to expire in 30 days” → Not possible: 7 days at most.

“SAS fails intermittently in the first minutes after creation” → Clock skew: start the SAS at least 15 minutes in the past, or omit the start time. Trap: wrong permissions.

“Firewall rules configured but the account is still open to all networks” → Set the default action to Deny. Trap: adding more IP rules.

“Allow a VM subnet in the same region through the firewall” → Enable the Microsoft.Storage service endpoint and add a VNet rule. Trap: an IP rule with the VM's private IP: private ranges aren't allowed.

“Add the on-premises range 10.0.0.0/8 to IP rules” → Not allowed: private ranges can't be used.

“Azure Monitor or another trusted service must reach the account behind the firewall” → Network exceptions (AzureServices, Logging, Metrics). Trap: adding its public IP when it runs in the same region.

“Add a subnet from a VNet in another Entra tenant” → Use CLI or PowerShell with the full subnet resource ID. Trap: the portal doesn't list cross-tenant subnets.

“Storage Explorer can't read blobs behind the firewall but the portal shows the account” → The firewall is data plane: the client must be inside the allowed boundary. Trap: a control-plane permission problem.

“Stop all SAS tokens that outlive the policy limit” → SAS expiration policy with the Block action. Trap: the Log action only records violations.

“Subnet deleted and recreated with the same name; access lost” → Its rule was removed: add the new subnet again. Trap: the rule restoring itself by name.

“Account disallows anonymous access; a container is set to Container” → Still no anonymous access: the account setting wins. Trap: the container level wins.

“Anonymous users must read a blob by URL but not list the container” → Container access level Blob. Trap: Container also allows listing.

Sources

Checked against Microsoft Learn on November 13, 2026.

← Redundancy & FailoverStorage Encryption →