Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Chapter 4Name in the course: Configure access to storage and storage accounts

Create and secure storage accounts

A storage account holds blobs, files, queues and tables under one name and one set of security settings. This chapter covers the account types, redundancy, and the ways to give and limit access: keys, SAS tokens, Entra roles and network rules.

  • 7 Lessons
  • 1 Commands

$ run as a normal user# run as root (or with sudo)

Skills in this chapter

  • Configure storage accounts, redundancy and access (keys, SAS, firewalls)

4.1

Choose the account type

Most accounts are Standard general-purpose v2 (StorageV2). Premium types are for low latency.

TypeFor
Standard general-purpose v2Blobs, files, queues, tables — the default
Premium block blobsMany small, fast blob operations
Premium file sharesFast SMB / NFS file shares
Premium page blobsUnmanaged disks (rare today)
az storage account create -n stshop2026 -g rg-data -l westeurope --sku Standard_ZRS --kind StorageV2 \
    --min-tls-version TLS1_2 --allow-blob-public-access false --https-only true
az storage account show -n stshop2026 --query "{sku:sku.name, kind:kind, tls:minimumTlsVersion}"

Remember

The account name is global: 3–24 small letters and digits, unique in all of Azure.

Commands in this lesson

4.2

Choose the redundancy

Azure always keeps several copies. The SKU decides where they are.

SKUCopiesSurvives
LRS3 in one data centreA disk or server failure
ZRS3 across 3 zonesLoss of one data centre
GRSLRS + 3 in the paired regionLoss of a region (failover needed)
RA-GRSGRS + read access to the copyRead during a regional outage
GZRS / RA-GZRSZRS + paired regionZone and region loss
az storage account update -n stshop2026 -g rg-data --sku Standard_RAGZRS

Commands in this lesson

4.3

Use access keys with care

Each account has two access keys with full rights. Rotate them one at a time; better: do not use them at all.

az storage account keys list -n stshop2026 -g rg-data -o table
az storage account keys renew -n stshop2026 -g rg-data --key key1
az storage account update -n stshop2026 -g rg-data --allow-shared-key-access false

Watch out

A leaked account key = full access to all data. Store keys in Key Vault, rotate them, or turn shared-key access off and use Entra roles.

Commands in this lesson

4.4

Give limited access with SAS

A shared access signature (SAS) is a signed URL with limited rights, scope and time.

SAS typeSigned withBest for
User delegation SASAn Entra identityBlobs — the most secure SAS
Service SASThe account keyOne service (blob, file, queue, table)
Account SASThe account keySeveral services
az storage container generate-sas --account-name stshop2026 --name invoices --permissions r --expiry 2026-11-01T00:00Z --auth-mode login --as-user -o tsv
az storage container policy create --account-name stshop2026 --container-name invoices --name read-30d --permissions r --expiry 2026-12-01

At work

A stored access policy on a container lets you cancel all SAS tokens made from it at once — delete or change the policy.

Commands in this lesson

4.5

Give data access with Entra roles

Data roles give users and apps access to blobs and queues without keys.

az role assignment create --assignee APP_OR_USER_ID --role "Storage Blob Data Contributor" \
    --scope /subscriptions/SUB_ID/resourceGroups/rg-data/providers/Microsoft.Storage/storageAccounts/stshop2026/blobServices/default/containers/invoices
az storage blob list --account-name stshop2026 --container-name invoices --auth-mode login -o table
RoleRights
Storage Blob Data ReaderRead blobs
Storage Blob Data ContributorRead, write, delete blobs
Storage Blob Data OwnerAlso set POSIX ACLs (Data Lake)
Storage File Data SMB Share ContributorRead and write on file shares with identity-based access

Commands in this lesson

4.6

Limit network access

The storage firewall allows only chosen networks and IPs. A private endpoint gives the account a private IP in your VNet.

az storage account update -n stshop2026 -g rg-data --default-action Deny
az storage account network-rule add -n stshop2026 -g rg-data --ip-address 203.0.113.10
az storage account network-rule add -n stshop2026 -g rg-data --vnet-name vnet-prod --subnet snet-app

Private endpoints are explained in Secure network access.

Commands in this lesson

4.7

Know the encryption options

All data is encrypted at rest. You choose who holds the key.

  • Microsoft-managed keys: the default, nothing to do.
  • Customer-managed keys in Key Vault: you control rotation and can revoke access.
  • Infrastructure encryption: a second layer of encryption.
  • In transit: HTTPS only and minimum TLS 1.2.

All commands in this chapter