Skip to main content
Quick Reference

Azure Cheatsheet

Azure on one page — RBAC, VNets, VMs, storage, and the traps around deallocate, NSGs, and Key Vault.

10 sections 10 tables 14 code snippets

Tenant and subscription

Which subscription the CLI will use

az account show

A region for the group

# -l centralindia

The hierarchy

PieceMeaning
TenantThe Microsoft Entra ID directory. Subscriptions belong to a tenant
SubscriptionThe billing boundary, and a scope roles inherit from
Resource groupA lifecycle container. Its own region is metadata. Members can run in other regions
Delete the groupDeletes every member, including resources that run in another region
CLI contextaz account show prints the active subscription. A resource in another one looks missing
Management groupSits above subscriptions. A role there flows down to every child

This page is Azure. Google Cloud is left out.

RBAC and identity

No password on the resource

# a managed identity has no client secret to rotate

Who can do what

PieceMeaning
Role assignmentA principal, a role, and a scope. Child scopes inherit it
OwnerManages resources and can grant roles
ContributorManages resources. Cannot assign roles
User Access AdministratorCan grant roles. Cannot create or change the resources
Managed identitySystem-assigned dies with the resource. User-assigned is its own resource and can be shared
Entra roleGlobal Administrator is not subscription Owner until access management for Azure resources is elevated

Virtual networks

Rule order

# the lower priority number is evaluated first

Paths and filters

PieceMeaning
VNetRegional. NICs in one subnet can sit in different availability zones
NSGAllow and deny rules, on a subnet or a NIC. Return traffic for an allowed flow is allowed
Both NSGsWhen a subnet NSG and a NIC NSG both exist, each one must allow the flow
DefaultsA new NSG allows virtual-network inbound and denies other inbound. Outbound to the internet starts allowed
Private endpointA private IP in your VNet for a PaaS resource. The name must resolve to that IP
Service endpointThe PaaS resource keeps its public address. The subnet is allowed through its firewall

Virtual machines

Release the hardware

az vm deallocate -g app-rg -n web-01

Local disk

# the temporary disk is wiped on deallocate

Power and disks

PieceMeaning
Portal StopDeallocates the VM. Compute billing stops. Disks and public IPs keep billing
az vm stopPowers the guest off and leaves the VM allocated, so compute billing continues
Guest shutdownSame result as az vm stop. The portal still shows Stopped (allocated)
Temporary diskLocal scratch space. Gone after deallocate. The OS disk and data disks stay
Public IPA Standard public IP remains across deallocate
Zone vs setA zone is a separate data center. An availability set splits fault domains and stays in one data center

Storage

Upload with Entra

az storage blob upload --auth-mode login --account-name logsprod -c reports -n 2026/report.csv -f report.csv

Offline tier

# Archive stays offline until rehydration finishes

Accounts and blobs

PieceMeaning
Account nameGlobally unique, 3 to 24 lowercase letters and numbers
CopiesLRS keeps three copies in one place. ZRS uses three zones. GRS adds an async copy in the paired region
RA-GRSThe paired-region copy can be read. Plain GRS cannot be read until failover
TiersHot, Cool (30-day minimum), Cold (90), Archive (180). Early delete is still billed for the minimum
ArchiveCannot be read or changed until it is rehydrated to an online tier. That can take hours
AnonymousNew accounts block public blob access. A public container still serves nothing while that block is on

Azure SQL and Cosmos DB

The secondary can be queried

# a geo-replica of Azure SQL can serve reads

Stay on one partition

# a query with no partition key fans out

Two data services

PieceMeaning
Azure SQLPaaS. You patch neither the OS nor the database host
Geo-replicaReadable. A failover group adds a read-write listener and a read-only listener
Partition keyChosen when the Cosmos container is created, and it cannot be changed later
Fan-outA query that omits the partition key reads across partitions and spends RU on each one
ConsistencySession is the Cosmos DB default
Item sizeOne Cosmos DB item is at most 2 MB

App Service and Functions

The HTTP clock

# an HTTP function must respond within 230 seconds

Plans and triggers

PieceMeaning
PlanThe SKU you pay for. Every app on that plan shares the compute
SlotRuns on the same plan. Swap exchanges the apps. A sticky setting stays with the slot
TimeoutFlex Consumption and Premium default to 30 minutes. Legacy Consumption defaults to 5 and caps at 10
HTTPThe response has to finish within 230 seconds on every plan
NetworkLegacy Consumption has no private endpoint and no VNet integration. Flex Consumption, Premium, and Dedicated have both
IdentityThe app calls Azure with its managed identity. Who may call the HTTP trigger is a separate setting

Key Vault

The data-plane role

# Key Vault Secrets User reads secret values

Control plane and data plane

PieceMeaning
ContentsSecrets, keys, and certificates
RBAC modelThe current model for new vaults. Data-plane roles are separate from Owner
Secrets UserCan get and list secrets. Owner of the vault does not, by that role alone
Access policyThe legacy model. A Contributor can write a policy and grant themselves secret access
Soft-deleteA deleted secret stays recoverable for the retention window
Purge protectionOnce enabled, it stays on and blocks purge until retention ends

Cost

What keeps charging

PieceMeaning
Data inInbound from the internet is free. Outbound to the internet is billed
DeallocateStops the compute charge. Disks, snapshots, and public IPs continue
SpotCan be evicted when Azure needs the capacity. A reservation commits for 1 or 3 years
BudgetSends an alert. It does not deallocate resources by itself
TagsGroup costs in Cost Management. They do not change the rate
SASA user-delegation SAS is limited by Entra and RBAC. An account-key SAS lasts until expiry or key rotation

Interview traps

Stop is not deallocate

# az vm stop leaves compute billing on

Look at the CLI context

# run az account show before chasing a missing resource

Traps worth memorising

TrapWhat happensPrefer
Shutdown inside the guestThe VM stays Stopped (allocated) and compute is billedPortal Stop, or az vm deallocate
Wrong subscriptionThe resource looks missingaz account show, then az account set
Contributor on the groupCan create the resource. Cannot grant a roleOwner, or User Access Administrator, at that scope
Plain GRSThe paired-region copy cannot be readRA-GRS when readers need the secondary
Public containerAnonymous reads still fail while the account blocks public accessLeave the account block on unless the blobs must be public
Owner on the vaultDoes not include reading secret values under RBACKey Vault Secrets User for reads

How to use this page: confirm the subscription, then the role and the scope, before you debug the resource.