Skip to content

Intermediate · Microsoft Azure essentials · topic 25 of 50 · 30 min

Azure compute and storage

Explanation

Azure Virtual Machines come in families such as B (burstable), D (general purpose), E (memory) and F (compute); availability sets and availability zones keep them running through failures, and VM Scale Sets add and remove copies. App Service runs web apps without managing servers, and Container Apps runs containers. A storage account holds Blob, Files, Queue and Table data with redundancy from LRS to GZRS, and blobs can live in Hot, Cool, Cold or Archive tiers.

Virtual machines

An Azure Virtual Machine is the same idea as an EC2 instance: you pick an image (Ubuntu, Windows Server), a size, a disk and a network, and you manage the operating system. Sizes are grouped into families by the job they do best.

FamilyGood forExample size name
B (burstable)Small apps that are mostly idle with short busy spells; builds up CPU creditsStandard_B2s
D (general purpose)Balanced CPU and memory: web servers, small databasesStandard_D2s_v5
E (memory optimised)More memory per CPU: databases, caches, analyticsStandard_E4s_v5
F (compute optimised)More CPU per GB of memory: batch work, game serversStandard_F4s_v2

Read a size name like Standard_D2s_v5 as: family D, 2 vCPUs, s means it can use premium SSD disks, v5 is the generation. There are also N (GPU), L (storage) and M (very large memory) families. Sizes and prices change often and differ by region, so check the current sizes page before you choose.

Staying up: availability sets and zones

An availability set spreads your VMs across fault domains (separate racks with their own power and network switch) and update domains (groups that Azure restarts one at a time during maintenance), all within one datacentre. Availability zones go further: VMs in different zones sit in different buildings with separate power and cooling. Zones protect against a whole datacentre failing; sets do not. For the exact uptime SLAs (for example two or more VMs across zones), check the current Azure SLA page.

A Virtual Machine Scale Set manages a group of similar VMs. It can add VMs when CPU is high and remove them at night (autoscale), and it can spread them across zones. It is the Azure match for an AWS Auto Scaling group.

App Service and Container Apps

Azure App Service is platform as a service (PaaS) for web apps and APIs in .NET, Java, Node.js, Python or PHP, or in a container. You push code and Azure handles the servers, patching and load balancing. The App Service plan sets the region, operating system, size and number of instances; several apps can share one plan. Higher tiers add features such as autoscale, deployment slots (a staging copy you swap into production) and private networking; check the docs for which tier has what.

bash
az webapp up --name canteen-api-asha --resource-group rg-demo \
  --location centralindia --runtime "PYTHON:3.12" --sku B1
Deploy the code in the current folder to App Service on a Basic B1 plan. The app name must be unique across Azure.

Azure Container Apps runs containers without you managing Kubernetes. It scales on HTTP traffic or queue length, can scale to zero, and keeps revisions so you can split traffic between versions. Containers are covered properly in a later module.

Storage accounts

A storage account is the container for Azure Storage data. Its name must be 3 to 24 lower-case letters and numbers and unique across all of Azure, because it becomes part of the address, such as https://stcanteen01.blob.core.windows.net. One general-purpose v2 account offers four services:

  • Blob storage: objects such as images, videos, backups and logs (like Amazon S3).
  • Azure Files: file shares over SMB or NFS that many machines can mount (like Amazon EFS or FSx).
  • Queue storage: simple message queues between parts of an app.
  • Table storage: a simple key and attribute NoSQL store.
RedundancyCopies keptSurvives
LRS (locally redundant)3 copies in one datacentreA disk or server failure
ZRS (zone-redundant)3 copies across 3 availability zones in one regionA whole datacentre or zone going down
GRS (geo-redundant)LRS in the primary region plus 3 copies in the paired regionA regional disaster (after failover)
GZRS (geo-zone-redundant)ZRS in the primary region plus 3 copies in the paired regionBoth a zone outage and a regional disaster

Add RA- (read access), as in RA-GRS, if you want to read from the secondary region even before a failover.

Blob access tiers

Storage price and access price pull in opposite directions. Hot has the highest storage price and the lowest cost to read. Cool, Cold and Archive are cheaper to store but cost more to read, and they have a minimum retention period: if you delete or move a blob earlier, you pay an early deletion charge for the remaining days.

TierUse it forMinimum daysRead speed
HotData used often: website images, active filesNoneMilliseconds
CoolUsed now and then: last month's reports, short-term backups30Milliseconds
ColdRarely used but needed fast when asked90Milliseconds
ArchiveAlmost never used: compliance records kept for years180Hours: the blob must be rehydrated first

Archive is offline. To read an archived blob you rehydrate it to Hot, Cool or Cold, which can take up to about 15 hours at standard priority (high priority is faster for small blobs). Check the access tiers page for current details and prices. Lifecycle management policies move blobs between tiers automatically, for example to Cool after 30 days and Archive after 180.

json
{
  "rules": [
    {
      "enabled": true,
      "name": "age-out-reports",
      "type": "Lifecycle",
      "definition": {
        "filters": { "blobTypes": ["blockBlob"], "prefixMatch": ["reports/"] },
        "actions": {
          "baseBlob": {
            "tierToCool": { "daysAfterModificationGreaterThan": 30 },
            "tierToArchive": { "daysAfterModificationGreaterThan": 180 },
            "delete": { "daysAfterModificationGreaterThan": 2555 }
          }
        }
      }
    }
  ]
}
A lifecycle policy: blobs in the reports container go Cool after 30 days, Archive after 180, and are deleted after about 7 years.

Sharing safely with SAS tokens

A shared access signature (SAS) is a signed URL that grants limited access, such as read-only on one blob for two hours. Prefer a user delegation SAS, which is signed with Entra ID credentials instead of the account key. Keep SAS lifetimes short, give only the permissions needed, and use HTTPS only.

bash
az storage blob generate-sas --account-name stcanteen01 \
  --container-name reports --name 2026-10.pdf \
  --permissions r --expiry 2026-10-20T18:00Z \
  --auth-mode login --as-user --https-only --full-uri
A read-only user delegation SAS for one file, valid until 18:00 UTC.
Careful: Common mistakes: (1) Moving data to Archive that people still open every week: every read needs hours of rehydration and costs extra. (2) Deleting Cool or Cold data after a few days and being surprised by early deletion charges. (3) Sharing the storage account key instead of a short SAS. (4) Choosing LRS for data you cannot lose; use ZRS or GZRS for important data. (5) Running one big VM in one zone and calling it highly available.

Need help?

Stuck on a word or an idea? Search this course, or every course, and jump straight to the explanation or a worked question.

Try:

Watch the lesson

Azure compute and storage · 1/7

Azure compute and storage

This lesson covers Azure compute and storage: virtual machines, App Service, and storage accounts.

Prefer a video by a teacher? Find free videos on “azure storage account blob access tiers hot cool cold archive redundancy LRS ZRS GRS” on YouTube ↗

In real life: Lab reports at a diagnostics chain

A diagnostics lab chain in Kolkata stores every patient report PDF in Blob storage. New reports are downloaded often in the first weeks, so they start in Hot. A lifecycle policy moves them to Cool after 30 days, when patients rarely open them, and to Archive after a year, where they stay for the legally required period. The storage account uses GZRS, so a datacentre outage or even a regional disaster does not lose data. Patients get a link with a user delegation SAS valid for 24 hours, so nobody can guess or reuse permanent links. The web portal runs on App Service with a Standard plan that scales out on busy Monday mornings.

Practice (0/3 done)

Task 1 · Question

Monthly sales reports are opened often for 3 weeks, then almost never, but must be readable within seconds for 2 years. Which plan is best?

Task 2 · Code · Python

Write choose_tier(reads_per_month, keep_days, need_instant) that returns the cheapest suitable blob tier using these simplified rules for this task, checked in this order: "Archive" if need_instant is False, keep_days >= 180 and reads_per_month <= 0.1; "Cold" if keep_days >= 90 and reads_per_month < 1; "Cool" if keep_days >= 30 and reads_per_month < 4; otherwise "Hot". (The day limits match the minimum retention periods, so you avoid early deletion charges.)

Task 3 · Practice

Choose compute and storage for a college results portal: about 50 visits a day for most of the year, and 50,000 visits in the hour results are published. Students download a PDF mark sheet. Old results must be kept for 10 years. Write your choices and why.

Quick quiz

Question 1

1.Which VM family is designed for small workloads that are idle most of the time with short CPU bursts?

Question 2

2.What protects VMs against a whole datacentre in a region going down?

Question 3

3.Which redundancy keeps 3 copies across availability zones AND copies in a paired region?

Question 4

4.You move a blob to Archive and delete it 60 days later. What happens?

Question 5

5.What is a SAS token?

Read more (free)

Open a question to see the answer and why. The first ones are this topic's own quiz, so try the quiz above before you peek.

Which VM family is designed for small workloads that are idle most of the time with short CPU bursts?

Answer: B series

B-series VMs build up CPU credits while idle and spend them during bursts.

What protects VMs against a whole datacentre in a region going down?

Answer: Spreading them across availability zones

Zones are physically separate datacentres. An availability set only spreads VMs across racks in one datacentre.

Which redundancy keeps 3 copies across availability zones AND copies in a paired region?

Answer: GZRS

GZRS is ZRS in the primary region plus asynchronous copies in the secondary region.

You move a blob to Archive and delete it 60 days later. What happens?

Answer: You pay an early deletion charge for the remaining 120 days

Archive has a 180-day minimum. Deleting at day 60 is charged as if stored for the remaining 120 days.

What is a SAS token?

Answer: A signed URL giving limited, time-bound access to storage

A shared access signature grants specific permissions until an expiry time, without sharing the account key.

Which service is Azure's identity platform, used for sign-in and single sign-on?Related

Answer: Microsoft Entra ID

Microsoft Entra ID (formerly Azure Active Directory) is Azure's identity service.

From AWS vs Azure vs Google Cloud: the service map

Which Indian Azure region is in Pune?Related

Answer: Central India

Central India is in Pune, South India in Chennai and West India in Mumbai.

From How Azure is organised: tenants, subscriptions and resource groups

Which service runs your container, scales with traffic and can scale down to zero?Related

Answer: Cloud Run

Cloud Run is serverless containers with scale to zero.

From Core Google Cloud services

What is an Availability Zone?Related

Answer: One or more data centres in a region with independent power, cooling and networking

AZs are isolated data centres inside one region, joined by low-latency links.

From Regions, availability zones and edge locations

Pass the quiz (60% or more) or mark this topic as done when you are ready.

Your progress is saved on this device only.

Next steps

  1. 1 more topic in “Microsoft Azure essentials” before its exam: Azure networking, Functions, databases and monitoring.
  2. Module 6 exam: Microsoft Azure essentials · 13 questions · 20 min, without help. 4 topics of this module still to finish first.
  3. Then the next module, Google Cloud and comparing the clouds. 50 topics left in the course before the final exam.

← Previous: Microsoft Entra ID and Azure RBAC