← All guides

Azure · 101 Guide

Azure 101 — the mental model, core services, and your first deploy

A from-scratch guide to Microsoft Azure for technical people new to the cloud: the mental model, accounts, identity, compute, storage, networking, databases, cost, observability, and a hands-on first deploy with the az CLI.

azurecloudrbacvmblobvnet

01What Azure is, and the mental model

Azure resource hierarchyManagement groups contain subscriptions, subscriptions contain resource groups, and resource groups hold the actual resources; every resource is pinned to one region made of availability zones.Management GroupSubscription (prod)Subscription (dev)rg-webrg-datarg-webrg-sharedVMDiskDBEach resource lives in one region (e.g. eastus) built from availability zones
The Azure resource hierarchy: A four-tier tree. At the top, a Management Group. Below it, two Subscriptions. Under each subscription sit Resource Groups. Inside one resource group are individual resources (a VM, a disk, a database). A band across the bottom notes that every resource lives in one region built from availability zones.

Azure is Microsoft's public cloud: you rent compute, storage, networking, and managed services on demand instead of buying servers. Four ideas make everything else click.

Regions and availability zones

Everything you create lives in a region — a geographic cluster of datacenters like eastus, westeurope, or uksouth. Most regions are divided into availability zones (AZs): physically separate datacenters with independent power and network. Spreading replicas across zones survives a datacenter failure; spreading across regions survives a regional outage. Latency and data-residency follow the region, so pick one close to your users and legal boundaries.

Three ways to touch Azure

  • Azure Portal — the web console. Great for learning and one-off inspection, bad for anything repeatable.
  • CLI / SDK — az (the official cross-platform CLI) or Az PowerShell. This guide uses az.
  • Infrastructure as Code (IaC) — Bicep (Azure-native) or Terraform. Declarative files you commit to git. Click in the portal to learn; script with az to automate; use Bicep/Terraform for anything that must be reproducible.

Shared responsibility

Microsoft secures the physical datacenters, the hypervisor, and the managed-service internals. You are responsible for your data, your identities and access, your network rules, and patching anything inside a VM you run. The more managed the service (Functions > Container Apps > VM), the less of the stack is yours to secure.

Pay-per-use

You are billed by the second/hour/GB/request for what you provision — not what you use inside it. An idle VM still bills; a stopped-but-not-deallocated VM still bills for compute. Delete what you are done with. The hands-on section ends with a teardown for exactly this reason.

02Accounts & organization

Azure's structure is a strict four-level tree. Learn it early — it is where access and billing attach.

The hierarchy

  • Management Groups — containers that group subscriptions so you can apply policy and RBAC once and have it inherit downward. A root management group spans your whole tenant.
  • Subscriptions — the billing and quota boundary. A subscription has its own invoice, its own spending limits, and its own resource quotas. Resources in different subscriptions are isolated by default.
  • Resource Groups — a logical folder for resources that share a lifecycle. Everything you deploy for one app/environment goes in one group so you can delete it all at once.
  • Resources — the actual VM, storage account, database, etc.

All of this lives inside one Microsoft Entra tenant (your identity directory — see the next section).

Recommended layout

For anything beyond a sandbox, separate environments by subscription, not just by resource group:

  • prod subscription, dev/test subscription, and a shared/platform subscription for things like networking and DNS.
  • Within each, one resource group per app per environment: rg-learntrainai-web-prod, rg-learntrainai-data-prod.
  • Group subscriptions under management groups (e.g. Platform, Workloads/Prod, Workloads/NonProd) so guardrails (Azure Policy) apply consistently.

This is the shape Microsoft's Cloud Adoption Framework landing zones formalize. Rule of thumb: a resource group should be deletable as a unit without taking down an unrelated app. If deleting the group would hurt, the grouping is wrong.

03Identity & access (IAM)

Azure splits identity from authorization. Get this distinction right and the rest of security follows.

Microsoft Entra ID

Microsoft Entra ID (formerly Azure AD) is the identity provider — it holds users, groups, and app identities, and handles sign-in, MFA, and conditional access. A tenant is one Entra directory. Authentication (*who are you?*) happens here.

Azure RBAC

Azure role-based access control (RBAC) handles authorization (*what may you do?*). Three pieces combine into a role assignment:

  • Security principal — a user, a group, or a workload identity (service principal / managed identity).
  • Role definition — a set of allowed actions. Built-ins include Reader, Contributor, Owner, and narrow ones like Storage Blob Data Reader.
  • Scope — where it applies: management group, subscription, resource group, or a single resource. Assignments inherit downward, so a role at a subscription applies to every resource group inside it.
az role assignment create \
  --assignee PRINCIPAL_ID_OR_EMAIL \
  --role "Storage Blob Data Reader" \
  --scope "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP"

Least privilege, in practice

  • Assign to groups, not individuals, and prefer narrow built-in roles over Owner/Contributor. Owner can also hand out access — reserve it.
  • Scope as tightly as the job allows (resource group, not subscription).
  • For app-to-Azure auth, use a managed identity so there is no secret to leak: Azure issues and rotates the credential, and the app requests a token at runtime.

How a request actually resolves

At call time Azure gathers every role assignment the principal has at the target scope and all parent scopes, unions the allowed actions, then applies any deny assignments (which win). No matching allow means deny by default. There is no implicit admin — even a tenant Global Administrator must be granted Azure RBAC to touch resources.

04Compute — the main ways to run code

Azure offers a spectrum from "you manage the OS" to "you manage nothing but code." Pick the least-managed option that still gives you the control you need.

The options

  • Virtual Machines (VMs) — a full Linux/Windows server you own and patch. Maximum control; maximum operational burden. Use for lift-and-shift, legacy software, or when you need specific kernels/GPUs.
  • Azure Kubernetes Service (AKS) — managed Kubernetes. Use when you genuinely need Kubernetes: many services, complex orchestration, an existing k8s investment, or a platform team to run it. It is a lot of surface area — do not reach for it by default.
  • Azure Container Apps — serverless containers on managed Kubernetes you never see. Scale-to-zero, HTTP ingress, revisions, and built-in Dapr. The sweet spot for most containerized microservices and APIs without the AKS tax.
  • Azure Functions — event-driven serverless functions. Pay per execution, scale to zero. Ideal for glue, webhooks, queue/timer triggers, and spiky low-baseline workloads.
  • Azure App Service — managed PaaS for web apps and APIs (code or container). Push code, get HTTPS, autoscale, slots, and easy custom domains without touching infrastructure.

How to choose

  • A website or HTTP API, want it running in minutes? → App Service.
  • Containerized services, want serverless scale without running a cluster? → Container Apps.
  • Event/queue/timer-driven, bursty, pay-per-call? → Functions.
  • Need full OS control, GPUs, or a legacy install? → VM.
  • Already standardized on Kubernetes with a team to operate it? → AKS.

Start as managed as you can; drop a tier only when you hit a real limit.

05Storage — object, block, and file

Three storage shapes cover almost everything. Match the shape to the access pattern.

The three shapes

  • Blob (object) storage — the default durable store for unstructured data: images, backups, logs, static assets, data-lake files. Accessed over HTTPS by key/path, effectively unlimited, cheap, and very durable. This is where bulk data belongs. It lives inside a Storage Account.
  • Managed Disks (block) — virtual hard drives attached to a VM. This is the block device your OS and databases write to (Premium SSD, Standard SSD, Standard HDD). One disk attaches to one VM at a time.
  • Azure Files (file) — fully managed SMB/NFS network shares you can mount from many machines at once. Use for lift-and-shift apps that expect a file share or need shared read/write.

Durability and redundancy

Blob replication is chosen per storage account:

  • LRS (locally redundant) — 3 copies in one datacenter. Cheapest.
  • ZRS (zone-redundant) — copies across availability zones in the region.
  • GRS / GZRS (geo-redundant) — also replicated to a paired region for disaster recovery.

Use ZRS/GZRS for data you cannot lose; LRS for reproducible or scratch data.

Lifecycle and tiers

Blob storage has access tiers — Hot (frequent), Cool (infrequent, 30+ days), Cold, and Archive (rarely read, retrieval takes hours and costs extra). Lifecycle management rules move blobs down tiers or delete them automatically:

az storage account management-policy create \
  --account-name STORAGE_ACCOUNT --resource-group RESOURCE_GROUP \
  --policy @lifecycle.json

Automatically tiering old data to Cool/Archive is one of the biggest easy cost wins.

06Networking — the virtual network model

Two-subnet VNet behind a public gatewayThe internet reaches a gateway that holds the only public IP; it forwards into a web subnet, and the web subnet alone reaches a private database subnet with no public IP, each subnet guarded by a network security group.InternetApp Gateway /LB (public IP)VNet 10.0.0.0/16Web subnet 10.0.1.0/24 + NSGappappDB subnet 10.0.2.0/24 + NSG (no public IP)database
A two-subnet VNet behind a gateway: Traffic from the internet hits an Application Gateway or Load Balancer that holds the only public IP. Behind it is a VNet addressed 10.0.0.0/16. Inside are two subnets: a web subnet (10.0.1.0/24) guarded by an NSG that holds the app instances, and a database subnet (10.0.2.0/24) guarded by its own NSG with no public IP. The gateway forwards to the web subnet, and the web subnet alone may reach the database subnet.

Azure networking is a software-defined private network you lay out yourself. The pieces are few.

Core pieces

  • Virtual Network (VNet) — your private IP space in a region, e.g. 10.0.0.0/16. Resources inside can talk privately.
  • Subnets — slices of the VNet, e.g. 10.0.1.0/24 for web, 10.0.2.0/24 for data. You segment by trust level.
  • Network Security Groups (NSGs) — stateful allow/deny rules (by port, protocol, source/destination) attached to a subnet or a VM's NIC. This is your firewall. Default: deny inbound from the internet, allow within the VNet — open ports deliberately.
  • Route tables (UDRs) — override default routing, e.g. force egress through a firewall appliance.
  • Public vs private — a resource is only reachable from the internet if it has a public IP (or sits behind something that does). Databases and app backends should have no public IP; reach them privately via the VNet or a Private Endpoint.

Load balancing — pick by layer

  • Azure Load Balancer — Layer 4 (TCP/UDP). Fast, protocol-agnostic, regional.
  • Application Gateway — Layer 7 (HTTP/HTTPS) with path-based routing, TLS termination, and an optional WAF (Web Application Firewall).
  • Azure Front Door — global Layer 7 entry point with CDN, edge TLS, and WAF for multi-region apps.

Use Application Gateway for a single-region web app that needs HTTP routing and a WAF; Front Door when you are global; a plain Load Balancer for non-HTTP or internal traffic.

The pattern

Put the public-facing tier (gateway/app) in one subnet with an NSG allowing 443; put databases in a private subnet with no public IP and an NSG that only accepts traffic from the web subnet. This keeps your data plane off the internet entirely.

07Databases — managed data stores

Prefer managed databases over running your own on a VM: Azure handles patching, backups, HA, and replication. Three cover most needs.

The common choices

  • Azure SQL Database — managed SQL Server engine; the default relational store on Azure. Automatic backups, point-in-time restore, and elastic scaling. Related: Azure Database for PostgreSQL / MySQL (Flexible Server) if your app speaks Postgres or MySQL. Use a relational DB whenever you need transactions, joins, and a strong schema — which is most line-of-business apps.
  • Azure Cosmos DB — globally distributed NoSQL with single-digit-millisecond reads and multiple APIs (NoSQL/document, MongoDB, Cassandra, Gremlin graph, Table). Use for planet-scale, high-throughput, low-latency workloads, flexible schemas, or multi-region active-active writes. Throughput is provisioned/consumed as Request Units (RU/s) — under-sizing throttles, over-sizing bills; it is the main cost lever.
  • Azure Cache for Redis — managed in-memory Redis for caching, sessions, leaderboards, and rate limiting. A cache in front of a database, not a system of record (though it persists optionally).

How to choose

  • Relational data with transactions and reporting → Azure SQL (or Azure Database for PostgreSQL/MySQL if that is your dialect).
  • Huge scale, flexible documents, global low latency → Cosmos DB.
  • Speed up reads / offload a hot path → Cache for Redis, alongside one of the above.

Connect apps using a managed identity where supported instead of embedding connection-string passwords, and keep databases on a private subnet/endpoint (see Networking).

08Billing & cost control

Azure bills per-use against a subscription. Cost discipline is a design concern, not an afterthought.

How you get charged

Compute by vCPU-hour, storage by GB-month plus operations, databases by provisioned tier or RU/s, and — critically — network egress (data leaving a region or Azure) by the GB. Ingress is generally free.

The things that surprise people

  • Idle resources still bill. A VM, an App Service plan, a provisioned database, or an unattached public IP/disk costs money whether or not traffic flows. **A "stopped" VM that is not *deallocated* still bills for compute** — deallocate or delete it.
  • Egress charges. Pulling data out across regions or to the internet adds up fast — chatty cross-region architectures and large downloads are a common bill shock.
  • Premium tiers chosen by default. Premium SSD, high App Service SKUs, and over-provisioned Cosmos RU/s quietly inflate costs. Right-size.
  • Orphans. Disks, public IPs, and snapshots left behind after you delete a VM keep charging.

Controls

  • Microsoft Cost Management — the dashboard for actual spend, cost analysis, and forecasts.
  • Budgets — set a monthly budget per subscription/resource group with email/webhook alerts at thresholds (budgets notify; they do not auto-stop spend).
az consumption budget create \
  --budget-name monthly-cap --amount 100 --time-grain Monthly \
  --category Cost --resource-group RESOURCE_GROUP
  • Tags — label every resource (env=prod, owner=team, cost-center=...). Cost Management groups spend by tag, so tagging is how you ever answer "what is this costing us?" Enforce required tags with Azure Policy.
  • Savings — Reserved Instances and Savings Plans cut steady compute 30–70% for 1–3 year commitments; use Spot VMs for interruptible work.

09Observability — where logs and metrics live

When something breaks, you need to know where to look before the incident, not during it.

The pieces

  • Azure Monitor — the umbrella service for telemetry. It collects two kinds of data: metrics (numeric time series — CPU, latency, request count, emitted automatically by most resources) and logs (structured events and traces).
  • Log Analytics workspace — the queryable store for log data. You query it with KQL (Kusto Query Language). Point your resources' diagnostic settings at a workspace so their logs land somewhere searchable — by default many logs are not retained until you do this.
  • Application Insights — Azure Monitor's APM layer for app-level traces, dependencies, exceptions, and request performance. Wire it into App Service / Functions / Container Apps.
  • Activity Log — the control-plane audit trail: who created, changed, or deleted a resource, and when. This is the first place to look when something *changed*.

First place to look in an incident

1. Is it a change or a failure? Check the Activity Log first — a bad deployment or deleted resource shows here immediately.

2. Resource health & metrics — open the affected resource in Azure Monitor; look at error-rate and latency metrics and Resource Health for platform issues.

3. Dig into logs — query the Log Analytics workspace / Application Insights with KQL for the failing requests and exceptions.

az monitor diagnostic-settings create \
  --name diag --resource RESOURCE_ID \
  --workspace WORKSPACE_ID \
  --logs '[{"category":"AuditLogs","enabled":true}]'

Set up diagnostic settings, an Application Insights resource, and a couple of metric alerts on day one — observability you add after the outage does not help with that outage.

10Your first deploy (hands-on)

A complete zero-to-running web app with the az CLI, then a clean teardown so it costs nothing. The App Service Basic (B1) SKU used here is a paid tier — small, but not free. The teardown at the end stops all charges.

0. Install and sign in

# install the CLI (macOS shown; see docs for Linux/Windows)
brew install azure-cli

az login                       # opens a browser to authenticate
az account list --output table # see your subscriptions
az account set --subscription SUBSCRIPTION_ID

Verify: az account show prints the subscription you expect.

1. Create a resource group

Everything goes in one group so the teardown is a single command.

az group create --name RESOURCE_GROUP --location REGION   # e.g. eastus

Verify: az group show --name RESOURCE_GROUP returns "provisioningState": "Succeeded".

2. Deploy a web app

From inside your app's source directory, az webapp up creates the App Service plan, the web app, and deploys your code in one step.

az webapp up \
  --name APP_NAME \
  --resource-group RESOURCE_GROUP \
  --location REGION \
  --runtime "NODE:20-lts" \
  --sku B1

APP_NAME must be globally unique (it becomes APP_NAME.azurewebsites.net). Swap the runtime for PYTHON:3.12, DOTNETCORE:8.0, etc.

Verify:

curl -I https://APP_NAME.azurewebsites.net   # expect HTTP/1.1 200 OK
az webapp show --name APP_NAME --resource-group RESOURCE_GROUP \
  --query state --output tsv                 # expect: Running

2b. (Alternative) Deploy a container to Container Apps

If you have a container image instead of source:

az containerapp up \
  --name APP_NAME \
  --resource-group RESOURCE_GROUP \
  --location REGION \
  --image mcr.microsoft.com/azuredocs/containerapps-helloworld:latest \
  --target-port 80 --ingress external

Verify: the command prints an FQDN; curl it and expect 200.

3. Tail the logs (optional)

az webapp log tail --name APP_NAME --resource-group RESOURCE_GROUP

4. Tear it down — do this to avoid charges

Deleting the resource group removes the app, the plan, and everything else in it.

az group delete --name RESOURCE_GROUP --yes --no-wait

Verify: az group show --name RESOURCE_GROUP eventually returns a *not found* error — that means it is gone and billing has stopped. Confirm in Cost Management a day later that nothing orphaned was left behind.

11Where to go next

You now have the mental model and a deploy under your belt. From here:

  • Keep the commands handy — the Azure CLI cheat sheet (azure-cli) on this hub is the terse companion to this guide: the exact az incantations for resource groups, RBAC, VMs, Blob, VNet, and App Service, without the prose.
  • Run it in production — the Azure SRE sheet (azure-sre) covers operating what you deploy: alerting, incident triage, scaling, and the KQL queries you reach for at 3 a.m.
  • Design the account structure properly — Cloud landing zones (cloud-landing-zones) walks the management-group / subscription / policy layout the Cloud Adoption Framework recommends before you scale past a sandbox.

Good next habits: put everything in Bicep or Terraform so deploys are reproducible; turn on budgets, tags, and diagnostic settings from day one; and always script a teardown alongside a deploy so nothing lingers on the bill.