🔷

Microsoft Azure Intermediate

Build on Azure: managed databases, serverless Functions, AKS containers, scaling, VNet design, monitoring and IaC with Bicep.

22 lessons 66 quiz questions
Lessons & quizzes Certificate

📚 Lessons & quizzes

Each lesson ends with its own short quiz. Answer them as you go — score 90% across all lessons to earn your certificate.

1 Azure SQL Database: a managed relational engine

Azure SQL Database is a fully managed Platform-as-a-Service (PaaS) relational database built on the SQL Server engine. Unlike a SQL Server running on a VM, you never patch the operating system, install the engine, or schedule your own backups — Azure handles high availability, patching and automated backups for you.

You choose a purchasing model: the DTU model bundles compute, memory and I/O into a single unit, while the newer vCore model lets you size CPU and storage independently and is required for advanced tiers like Hyperscale and Serverless. A single logical server is just an administrative container for one or more databases; it is not a machine you can log into.

# Create a logical server and a database in the vCore General Purpose tier
az sql server create -g rg-app -n sql-app-01 \
  --admin-user sqladmin --admin-password '<StrongP@ss>'

az sql db create -g rg-app -s sql-app-01 -n appdb \
  --edition GeneralPurpose --family Gen5 --capacity 2 \
  --compute-model Provisioned

2 Azure Cosmos DB: globally distributed NoSQL

Azure Cosmos DB is a globally distributed, multi-model NoSQL database designed for low latency and elastic scale. You pick an API when you create an account — the native Core (SQL) API for JSON documents, or compatibility APIs for MongoDB, Cassandra, Gremlin (graph) and Table.

Throughput is measured in Request Units per second (RU/s): every read or write costs a number of RUs depending on item size and complexity. You either provision RU/s or use the serverless mode for spiky workloads. Cosmos DB also offers five well-defined consistency levels — Strong, Bounded Staleness, Session, Consistent Prefix and Eventual — trading consistency for latency and availability.

# Create a Cosmos DB account using the Core (SQL) API with serverless capacity
az cosmosdb create -g rg-app -n cosmos-app-01 \
  --kind GlobalDocumentDB \
  --capabilities EnableServerless \
  --default-consistency-level Session

3 Azure Functions: serverless compute

Azure Functions lets you run small pieces of code (“functions”) without managing servers. Each function is started by a trigger — an HTTP request, a timer, a new blob, a queue message or an Event Grid event — and can use bindings to read and write other services declaratively, without writing connection boilerplate.

The Consumption plan bills per-execution and scales to zero when idle, but can suffer cold starts. The Premium plan keeps pre-warmed instances and adds VNet integration, while the Dedicated (App Service) plan runs on VMs you already pay for. A function app groups functions and shares one configuration and storage account.

# Create a Consumption-plan Function App (needs a storage account)
az functionapp create -g rg-app -n func-app-01 \
  --storage-account stappfunc01 \
  --consumption-plan-location westeurope \
  --runtime dotnet-isolated --functions-version 4

4 Azure App Service: hosting web apps and APIs

Azure App Service is a managed platform for hosting web apps, REST APIs and mobile back ends in many languages (.NET, Java, Node.js, Python, PHP). You deploy your code or a container and Azure runs it; you do not manage the OS or web server.

Apps run inside an App Service Plan, which defines the region, the VM size and the number of instances — and therefore the cost. Multiple apps can share one plan. Key features include deployment slots for staging and zero-downtime swaps, built-in autoscale, custom domains with managed TLS certificates, and App Settings that surface as environment variables.

# Create a Linux plan and a Node.js web app, then add a staging slot
az appservice plan create -g rg-app -n plan-web-01 \
  --sku P1v3 --is-linux

az webapp create -g rg-app -p plan-web-01 -n web-app-01 \
  --runtime 'NODE:20-lts'

az webapp deployment slot create -g rg-app -n web-app-01 --slot staging

5 Azure Container Registry (ACR)

Azure Container Registry (ACR) is a managed, private registry for storing and distributing OCI container images and Helm charts. It comes in three tiers — Basic, Standard and Premium — differing in storage, throughput and features like geo-replication and private endpoints (Premium only).

You authenticate with Azure AD identities rather than long-lived passwords where possible. ACR can also build images in the cloud with ACR Tasks (az acr build), so you do not need a local Docker daemon. To let a cluster pull images securely, you attach the registry to the cluster identity instead of embedding credentials.

# Create a registry and build an image server-side with ACR Tasks
az acr create -g rg-app -n acrapp01 --sku Standard

az acr build -r acrapp01 -t web-app:v1 .

# Push/pull use the login server acrapp01.azurecr.io

6 Azure Kubernetes Service (AKS)

Azure Kubernetes Service (AKS) is a managed Kubernetes offering. Azure runs and patches the control plane for free; you pay only for the node pools (the VMs that run your pods). A cluster can have a system node pool for cluster services and separate user node pools for workloads.

AKS integrates with Azure AD for authentication, with ACR for pulling images, and with Azure Monitor for observability. The cluster autoscaler adds and removes nodes based on pending pods, while the Horizontal Pod Autoscaler scales pod replicas based on metrics. You connect with kubectl after fetching credentials.

# Create an AKS cluster attached to an existing registry, then get credentials
az aks create -g rg-app -n aks-app-01 \
  --node-count 2 --enable-cluster-autoscaler \
  --min-count 2 --max-count 5 \
  --attach-acr acrapp01 --generate-ssh-keys

az aks get-credentials -g rg-app -n aks-app-01
kubectl get nodes

7 Azure Container Instances (ACI)

Azure Container Instances (ACI) runs a single container or a small container group without any cluster to manage. It is ideal for short-lived jobs, batch processing, build agents and simple microservices where the orchestration features of AKS would be overkill. Billing is per-second based on the CPU and memory you request.

ACI starts in seconds and supports public IPs, mounted Azure Files shares, and environment variables. AKS can even burst excess pods to ACI through virtual nodes. The trade-off versus AKS is that ACI has no built-in scheduling, self-healing or service discovery — it simply runs the containers you ask for.

# Run a single container that exposes port 80 with a public DNS label
az container create -g rg-app -n aci-web \
  --image acrapp01.azurecr.io/web-app:v1 \
  --cpu 1 --memory 1.5 \
  --ports 80 --dns-name-label aci-web-demo \
  --restart-policy OnFailure

8 Load Balancer vs Application Gateway vs Front Door

Azure offers several ways to distribute traffic, and choosing the right one matters. Azure Load Balancer works at Layer 4 (TCP/UDP): it is fast and protocol-agnostic but cannot read HTTP paths or host names. Application Gateway works at Layer 7: it understands HTTP, supports path- and host-based routing, TLS termination, and an optional Web Application Firewall (WAF) — but it is regional.

Azure Front Door is a global, Layer-7 entry point that adds a CDN, anycast routing to the nearest edge, and global failover across regions. A common pattern is Front Door at the edge, Application Gateway inside a region, and Load Balancer for internal Layer-4 traffic.

# A public Layer-4 Load Balancer with a backend pool
az network lb create -g rg-app -n lb-app-01 \
  --sku Standard \
  --public-ip-address pip-lb-01 \
  --frontend-ip-name fe1 --backend-pool-name pool1

9 Virtual Machine Scale Sets and autoscaling

A Virtual Machine Scale Set (VMSS) manages a group of identical VMs from a single configuration, making it easy to run many copies of a workload behind a load balancer. You can scale manually by setting an instance count, or attach autoscale rules that add and remove instances based on metrics like CPU percentage or queue length, or on a schedule.

Autoscale rules use a cooldown period to avoid flapping and should always pair a scale-out rule with a scale-in rule. VMSS supports rolling upgrades, availability zones and spot instances for cost savings. The cloud sometimes calls the metric-driven engine autoscale settings, attached to the scale set resource.

# Create a scale set, then add a CPU-based autoscale profile
az vmss create -g rg-app -n vmss-app-01 \
  --image Ubuntu2204 --instance-count 2 --vm-sku Standard_B2s

az monitor autoscale create -g rg-app \
  --resource vmss-app-01 --resource-type Microsoft.Compute/virtualMachineScaleSets \
  --name autoscale-vmss --min-count 2 --max-count 10 --count 2

az monitor autoscale rule create -g rg-app --autoscale-name autoscale-vmss \
  --condition 'Percentage CPU > 70 avg 5m' --scale out 1

10 VNet peering and routing

A Virtual Network (VNet) is isolated by default. To let resources in two VNets talk directly — even across regions or subscriptions — you create a VNet peering. Peered traffic stays on the Microsoft backbone, is low-latency, and uses private IPs; peering is non-transitive, so if A peers with B and B peers with C, A still cannot reach C without its own peering or a hub.

Routing inside a VNet is controlled by system routes plus your own User-Defined Routes (UDRs) in a route table. A common pattern forces traffic through a firewall using a UDR with next hop Virtual Appliance. The hub-and-spoke topology relies on peering plus UDRs to centralise shared services.

# Peer two VNets in both directions (peerings are created per side)
az network vnet peering create -g rg-net -n hub-to-spoke \
  --vnet-name vnet-hub --remote-vnet vnet-spoke \
  --allow-vnet-access --allow-forwarded-traffic

az network vnet peering create -g rg-net -n spoke-to-hub \
  --vnet-name vnet-spoke --remote-vnet vnet-hub \
  --allow-vnet-access

11 Private Endpoints vs Service Endpoints

By default, PaaS services like Storage and SQL have public endpoints. To restrict access, Azure offers two mechanisms. A Service Endpoint extends your VNet identity to the service over the Azure backbone and lets the service firewall allow specific subnets — but the service keeps its public IP.

A Private Endpoint goes further: it places a network interface with a private IP from your subnet in front of the service, so the resource is reachable over a truly private address and can be locked down from the public internet entirely. Private Endpoints are powered by Azure Private Link and usually pair with a private DNS zone so the service hostname resolves to the private IP.

# Create a Private Endpoint to a storage account's blob service
az network private-endpoint create -g rg-app -n pe-storage \
  --vnet-name vnet-app --subnet snet-data \
  --private-connection-resource-id $(az storage account show -g rg-app -n stappdata01 --query id -o tsv) \
  --group-id blob --connection-name pe-storage-conn

12 Azure DNS

Azure DNS hosts DNS domains on Microsoft infrastructure. A public DNS zone resolves names on the internet — you delegate your domain by pointing its registrar at the Azure name servers. A private DNS zone resolves names only inside linked VNets, which is essential for Private Endpoints to map a hostname to a private IP.

You manage records (A, AAAA, CNAME, MX, TXT, SRV) as resources, and Azure DNS supports alias records that point directly at Azure resources (like a Public IP or Front Door) and update automatically if the target changes. With auto-registration, a private zone can record VM hostnames automatically.

# Create a private zone and link it to a VNet with auto-registration
az network private-dns zone create -g rg-net -n privatelink.blob.core.windows.net

az network private-dns link vnet create -g rg-net \
  --zone-name privatelink.blob.core.windows.net \
  --name link-app --virtual-network vnet-app \
  --registration-enabled true

13 Azure CDN: caching at the edge

A Content Delivery Network (CDN) caches static content — images, scripts, video — at edge points of presence (PoPs) close to users, cutting latency and offloading your origin. Azure CDN defines an endpoint that fronts an origin (a storage account, web app or any public host).

You control freshness with caching rules and Time-To-Live (TTL), and you can purge the cache to force re-fetching after a deploy. Dynamic content can use query-string caching modes. Note that Azure Front Door now includes CDN capabilities, so new designs often consolidate on Front Door rather than a standalone CDN profile.

# Create a CDN profile and an endpoint fronting a storage origin
az cdn profile create -g rg-app -n cdn-app --sku Standard_Microsoft

az cdn endpoint create -g rg-app --profile-name cdn-app \
  -n cdn-app-ep \
  --origin stappweb01.z6.web.core.windows.net \
  --origin-host-header stappweb01.z6.web.core.windows.net

14 Managed identities and RBAC in depth

A managed identity is an Azure AD identity that Azure manages for you, eliminating credentials in code. A system-assigned identity is tied to one resource and deleted with it; a user-assigned identity is a standalone resource you can attach to many resources and reuse.

What an identity can do is governed by Role-Based Access Control (RBAC): a role assignment binds a security principal to a role definition (a set of allowed actions) over a scope (management group, subscription, resource group or resource). Permissions are additive and inherited down the hierarchy, while an explicit deny assignment overrides allows. Prefer least-privilege built-in roles like Storage Blob Data Reader over the broad Contributor.

# Give a web app's system identity read access to a storage account
az webapp identity assign -g rg-app -n web-app-01

PRINCIPAL=$(az webapp identity show -g rg-app -n web-app-01 --query principalId -o tsv)
SCOPE=$(az storage account show -g rg-app -n stappdata01 --query id -o tsv)

az role assignment create --assignee $PRINCIPAL \
  --role 'Storage Blob Data Reader' --scope $SCOPE

15 Azure Key Vault: secrets, keys and certificates

Azure Key Vault centrally stores secrets (passwords, connection strings), keys (for encryption) and certificates, keeping them out of code and config files. Apps read secrets at runtime using a managed identity, so credentials never live in source control.

Access is controlled either by the legacy access policies or, preferably, by Azure RBAC data-plane roles like Key Vault Secrets User. Vaults support soft delete and purge protection to recover from accidental deletion, and secrets can be versioned. App Service and Functions can fetch a secret automatically with a Key Vault reference in App Settings.

# Create an RBAC-enabled vault, store a secret, and grant an app access
az keyvault create -g rg-app -n kv-app-01 \
  --enable-rbac-authorization true

az keyvault secret set --vault-name kv-app-01 \
  --name DbPassword --value '<StrongP@ss>'

az role assignment create --assignee $PRINCIPAL \
  --role 'Key Vault Secrets User' \
  --scope $(az keyvault show -n kv-app-01 --query id -o tsv)

16 Azure Monitor and Log Analytics

Azure Monitor is the umbrella platform for observability. It collects two kinds of data: numeric metrics (fast, time-series, near real time) and richer logs (events, traces). Logs are sent to a Log Analytics workspace, where you query them with the Kusto Query Language (KQL).

On top of this you build alerts (metric, log or activity-log based) that fire action groups (email, SMS, webhook, Logic App), and dashboards and workbooks for visualisation. Application Insights extends Monitor with deep application telemetry — request rates, dependencies and exceptions. Diagnostic settings route resource logs into the workspace.

# Create a workspace and route a web app's logs into it
az monitor log-analytics workspace create -g rg-app -n law-app-01

WID=$(az monitor log-analytics workspace show -g rg-app -n law-app-01 --query id -o tsv)

az monitor diagnostic-settings create \
  --name diag-web --resource $(az webapp show -g rg-app -n web-app-01 --query id -o tsv) \
  --workspace $WID \
  --logs '[{"category":"AppServiceHTTPLogs","enabled":true}]'

17 Service Bus vs Event Grid: messaging patterns

Azure provides distinct messaging services for distinct jobs. Azure Service Bus is an enterprise message broker for reliable command and work-queue scenarios: it offers queues (point-to-point) and topics/subscriptions (publish-subscribe), with ordering (sessions), dead-lettering, transactions and at-least-once delivery. Consumers pull messages.

Azure Event Grid is a lightweight event router built for reactive, event-driven architectures. It pushes small event notifications (“a blob was created”) to many subscribers via HTTP webhooks or functions, with massive fan-out and filtering. Rule of thumb: Service Bus for commands/work that must not be lost; Event Grid for broadcasting that something happened.

# A Service Bus namespace with a queue, and an Event Grid topic
az servicebus namespace create -g rg-app -n sb-app-01 --sku Standard
az servicebus queue create -g rg-app \
  --namespace-name sb-app-01 -n orders --max-delivery-count 10

az eventgrid topic create -g rg-app -n egt-app-01 -l westeurope

18 Storage account tiers and lifecycle management

Azure Blob Storage offers access tiers that trade storage price against access price. Hot is cheapest to read but most expensive to store; Cool (min 30 days) suits infrequently accessed data; Cold (min 90 days) is cheaper still; and Archive is the cheapest to store but offline — you must rehydrate a blob (hours) before reading it.

Rather than re-tier blobs by hand, you attach a lifecycle management policy: rules that automatically move blobs to cooler tiers or delete them after a number of days since last modification or last access. Combined with the right redundancy (LRS, ZRS, GRS), this controls both cost and durability.

# A lifecycle policy: move to Cool after 30 days, Archive after 90, delete after 365
az storage account management-policy create \
  --account-name stappdata01 -g rg-app \
  --policy '{"rules":[{"name":"tier-down","enabled":true,"type":"Lifecycle","definition":{"filters":{"blobTypes":["blockBlob"]},"actions":{"baseBlob":{"tierToCool":{"daysAfterModificationGreaterThan":30},"tierToArchive":{"daysAfterModificationGreaterThan":90},"delete":{"daysAfterModificationGreaterThan":365}}}}}]}'

19 ARM templates and the move to Bicep

Azure resources are described declaratively with Infrastructure as Code (IaC). The original format is the ARM template: a verbose JSON document listing resources, parameters and outputs that the Azure Resource Manager deploys idempotently. JSON is hard to author and review at scale.

Bicep is a cleaner domain-specific language that transpiles to ARM JSON. It removes boilerplate, adds modules, type safety and simple expressions, and needs no state file because Azure itself is the source of truth. Deployments are idempotent: re-running converges to the declared state, and what-if previews changes before you apply them.

// main.bicep — a storage account from two parameters
param location string = resourceGroup().location
param name string

resource sa 'Microsoft.Storage/storageAccounts@2023-01-01' = {
  name: name
  location: location
  sku: { name: 'Standard_LRS' }
  kind: 'StorageV2'
}

output blobEndpoint string = sa.properties.primaryEndpoints.blob

20 Deploying Bicep with Azure CLI and GitHub Actions

Once you have a Bicep file you deploy it through the Resource Manager. From the CLI you run az deployment group create against a resource group, passing parameters. The deployment is idempotent, so committing the file and re-deploying keeps environments consistent.

For automation you put the deployment in a pipeline. With GitHub Actions you authenticate using OpenID Connect (OIDC) federation to a service principal — no stored secret — then run the same az deployment command on every push. Azure DevOps Pipelines achieve the same with a service connection and an AzureCLI task.

# .github/workflows/deploy.yml (excerpt)
jobs:
  deploy:
    runs-on: ubuntu-latest
    permissions: { id-token: write, contents: read }
    steps:
      - uses: actions/checkout@v4
      - uses: azure/login@v2
        with:
          client-id: ${{ secrets.AZURE_CLIENT_ID }}
          tenant-id: ${{ secrets.AZURE_TENANT_ID }}
          subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
      - run: az deployment group create -g rg-app -f main.bicep -p name=stappdata01

21 Backup and snapshots

Resilience needs more than redundancy. Azure Backup, centred on a Recovery Services vault, provides application-consistent backups for VMs, Azure Files, SQL in VMs and more, governed by backup policies (schedule plus retention). It supports point-in-time restore and is isolated from the source so ransomware on a VM cannot delete its backups.

A managed disk snapshot is a cheaper, point-in-time read-only copy of a disk, handy for quick clones or pre-change safety points; you can create a new disk from a snapshot. Databases have their own story: Azure SQL keeps automated backups enabling point-in-time restore within the retention window, and Cosmos DB offers continuous backup.

# Take a snapshot of a VM OS disk, then enable VM backup
DISK=$(az vm show -g rg-app -n vm-app-01 --query storageProfile.osDisk.managedDisk.id -o tsv)
az snapshot create -g rg-app -n snap-vm-app-01 --source $DISK

az backup protection enable-for-vm -g rg-app \
  --vault-name rsv-app-01 --vm vm-app-01 --policy-name DefaultPolicy

22 Putting it together: a reference architecture

A typical intermediate Azure design layers the services from this course. At the edge, Front Door (with WAF and CDN) routes global traffic to a regional Application Gateway, which load-balances across an App Service or AKS back end. Compute reaches data through Private Endpoints into Azure SQL or Cosmos DB, with a private DNS zone resolving the names.

Secrets live in Key Vault, accessed via managed identities and least-privilege RBAC. Service Bus and Event Grid decouple components, Azure Monitor and Application Insights provide observability, and the whole estate is described in Bicep and shipped by a GitHub Actions pipeline. This separation of edge, compute, data, identity, messaging and IaC is the backbone of well-architected Azure solutions.

🎓 Certificate of Completion

🔒 Complete every lesson quiz above with 90%+ to unlock your downloadable certificate.