Learnings

Cloud and DevOps

Azure

The same cloud map, drawn for Azure: where things live, who may touch them, which compute, storage, database and messaging service to pick, and how a small bank API fits together. Every table carries the AWS and GCP equivalent, so it reads next to the AWS and GCP pages. Nothing here was run against Azure: there was no account. The az flags were checked against the help text of azure-cli 2.79.0 installed in a virtual environment, the Python snippet was checked for imports and signatures against azure-storage-blob 12.28, and one SAS token was signed offline with a made-up key. Prices, quotas and limits are approximate: check the docs.

The map

Part 1 of 6 · where a resource lives

Tenant to resource group

The map

Every resource sits in exactly one resource group, inside one subscription, under one tenant. Policy and access set at a higher level flow down.

Four levels of scope. A role or policy assigned at any box applies to everything below it.
Azure levelWhat it is forAWSGCP
TenantOne Microsoft Entra ID directory: users, groups, appsOrganization + IAM Identity CenterOrganization + Cloud Identity
Management groupGroup subscriptions for policy and accessOrganizational unit (OU)Folder
SubscriptionBilling, quota and isolation boundaryAccountProject
Resource groupThings deployed and deleted togetherNo real match: tags, or a CloudFormation stackNo real match: labels (a project is often used this way)
Azure PolicyRules such as "only these regions"Service control policies, Config rulesOrganization policies

Trap: a resource group has a location, but that is only where its metadata is stored. The resources inside can be in any region. Deleting the group deletes everything in it.

Regions, zones and pairs

The map

A region is a set of datacenters. Most large regions have three availability zones, and many regions have a fixed partner region used for geo-redundant storage and staggered platform updates.

Zones protect against a datacenter failure, the pair against a regional one.
Azure termMeaningAWSGCP
RegionWhere the resource runsRegionRegion
Availability zoneSeparate power, cooling, networkAvailability ZoneZone
Region pairBuilt-in partner for geo-replicationNone: you choose a second regionNone: dual and multi-regions for storage
LRS, ZRS, GRS, GZRSStorage copies: one datacenter, three zones, plus the pairS3 is multi-AZ by default; cross-region replicationRegional, dual-region, multi-region buckets

Trap: zone numbers are logical per subscription. "Zone 1" in two subscriptions may be different buildings, as with AWS zone names.

Identity and access

Part 2 of 6 · who may do what, where

Microsoft Entra ID

Identity and access

Entra ID (called Azure Active Directory until 2023) is the directory behind a tenant. It issues OAuth 2.0 tokens to people and to workloads, and every Azure API call carries one.

Entra objectWhat it isAWSGCP
User, groupPeople, and sets of peopleIdentity Center user, groupGoogle account, group
Service principalThat application's identity inside one tenantIAM role (or IAM user with keys)Service account
Managed identityA service principal whose credentials Azure rotatesIAM role on a resourceAttached service account

Trap: there are two role systems. Entra roles (Global Administrator, User Administrator) manage the directory. Azure RBAC roles (Owner, Contributor) manage resources. A Global Administrator has no access to a subscription's resources by default.

RBAC: role, scope, assignment

Identity and access

Access is a role assignment: one principal, one role definition, one scope. Assignments only add permissions, and they are inherited by every scope below.

Who, what, where. The effective permission is the union of all assignments at the resource and above it.
ConceptAzureAWSGCP
Permission setRole definition: Actions, DataActionsIAM policy documentRole (a list of permissions)
GrantRole assignment at a scopePolicy attached to a role, user or resourceRole binding in an allow policy
ScopesManagement group, subscription, resource group, resourceAccount; resource ARNs inside the policyOrganization, folder, project, resource
Explicit denyNot in assignments (deny assignments are system-made)Yes, Deny winsDeny policies
Broad rolesOwner, Contributor, ReaderAdministratorAccess, PowerUserAccess, ReadOnlyAccessOwner, Editor, Viewer

Trap: control plane and data plane are separate. Contributor can create a storage account but cannot read a blob with its Entra token: that needs a data role such as Storage Blob Data Reader. Contributor can still list the account keys, which is one reason to disable shared key access.

Data roles the bank uses: Storage Blob Data Contributor, Azure Service Bus Data Sender, Azure Service Bus Data Receiver, Key Vault Secrets User, AcrPull.

Service principals and managed identities

Identity and access

A workload needs an identity too. Inside Azure use a managed identity, so there is no secret to store. Outside Azure use a service principal, with a federated credential where possible.

The app never holds a password. The platform proves which resource is asking.
IdentityCredentialUse it forAWSGCP
System-assigned managed identityNone you can see; dies with the resourceOne app, one identityInstance profile, task roleAttached service account
User-assigned managed identityNone you can see; its own resourceShared by several apps, survives redeploysOne IAM role used by manyOne service account used by many
Service principal + federated credentialTrusts an external OIDC tokenGitHub Actions, another cloudIAM role with an OIDC providerWorkload Identity Federation
Service principal + secret or certificateYou store and rotate itLast resortIAM user access keysService account key file

In Python, DefaultAzureCredential from azure-identity tries the managed identity in Azure and your az login session on a laptop, so the same code runs in both places.

Compute and data

Part 3 of 6 · where code runs and where state lives

Which compute

Compute and data

Pick the highest level of abstraction that still fits. Each step down buys control and costs operations work.

For a containerised HTTP API plus a queue worker, the answer is usually Container Apps.
ServiceYou manageScalingAWSGCP
Virtual Machines, Scale SetsOS, patches, runtime, appScale set rules, minutesEC2, Auto Scaling groupsCompute Engine, MIGs
App ServiceCode or one containerInstances of a plan; deployment slots for swapsElastic Beanstalk, App RunnerApp Engine
Container AppsImage and scale rules0 to N replicas on HTTP or queue lengthECS on Fargate, App RunnerCloud Run
AKSNode pools, add-ons, upgrades, manifestsPods and nodesEKSGKE
FunctionsA function and its triggerPer event, to zero on consumption plansLambdaCloud Run functions

Container Apps nouns: an environment (shared VNet and logs) holds apps, each deploy makes an immutable revision, and a revision runs as 0 to N replicas. Scale rules come from KEDA, so the worker scales on queue length and the API keeps a minimum of one replica to avoid cold starts.

Interview point: choose AKS for a reason you can name: custom operators, a service mesh, many teams on one platform. "We might need it later" is not one.

Blob Storage: tiers and lifecycle

Compute and data

A storage account holds containers, a container holds blobs. Colder tiers cost less to store and more to read, and each has a minimum stay that is billed even if you delete early.

A lifecycle policy for bank statements. The rule engine moves blobs about once a day.
TierMinimum stay (approx.)ReadAWS S3GCP Cloud Storage
HotNoneMillisecondsStandardStandard
Cool30 daysMilliseconds, per-GB read feeStandard-IANearline
Cold90 daysMilliseconds, higher read feeGlacier Instant RetrievalColdline
Archive180 daysOffline: rehydrate first, up to hoursGlacier Flexible Retrieval, Deep ArchiveArchive (still online)

The policy in the figure. Not run for this page; field names checked against the storage management SDK model.

SAS tokens

Compute and data

A shared access signature is a signed query string that grants limited access to storage for a limited time. It lets a browser download a statement straight from Blob Storage without the file passing through the API.

The API authorises, storage serves. The API authenticates with its managed identity, never an account key.
SAS typeSigned withRevoke byAWSGCP
User delegation SASA key obtained with an Entra token (max about 7 days)Revoking the delegation keys, or removing the rolePresigned URL from role credentialsSigned URL from a service account
Service SASStorage account keyStored access policy, or rotating the keyPresigned URL from user keysSigned URL from an HMAC key

Not run against Azure: it needs a storage account.

The query string that generate_blob_sas returned in the offline run, one field per line. The key, ids and signature are fake.

Expiry (se), permission (sp=r), resource (sr=b, one blob), who asked for the key (skoid, sktid) and the signature. Change any field and the signature no longer matches.

Trap: a SAS is a bearer token. Anyone holding the URL has the access, so keep it short-lived, read-only and HTTPS-only, and keep it out of logs.

Azure SQL

Compute and data

Azure SQL is managed Microsoft SQL Server in three shapes. The bank's ledger goes in SQL Database: one database on a logical server, with backups, patching and failover handled for you.

ChoiceOptionsPick whenAWSGCP
DeploymentSQL Database, SQL Managed Instance, SQL Server on a VMNew app; lift and shift; full OS controlRDS for SQL Server; RDS Custom; EC2Cloud SQL for SQL Server; Compute Engine
ComputeProvisioned or serverless (auto-pause)Serverless for dev and spiky loadAurora Serverless (closest)No close match
TierGeneral Purpose, Business Critical, HyperscaleDefault; low latency plus a read replica; very largeRDS Multi-AZ; AuroraCloud SQL HA; AlloyDB
Geo failoverFailover groupRegional disaster recoveryCross-region read replicaCross-region replica
LoginEntra ID (managed identity) or SQL loginEntra, so there is no passwordIAM database authenticationIAM database authentication

Trap: a serverless database that auto-paused takes a while (often about a minute) to resume, and the first connection fails or waits. Retry with backoff, or turn auto-pause off in production.

Cosmos DB, PostgreSQL, Redis

Compute and data

Three more stores cover most backend needs. Start with a relational database and add the others for a reason.

ServiceModelKnow thisBank useAWSGCP
Cosmos DBPartitioned JSON documents, global distributionBilled in request units; partition key is forever; five consistency levels from strong to eventualActivity feed, sessionsDynamoDBFirestore, Bigtable
PostgreSQL Flexible ServerManaged PostgreSQLZone-redundant standby, read replicas, built-in PgBouncerThe ledger, if the team prefers PostgresRDS for PostgreSQLCloud SQL for PostgreSQL
Azure Cache for RedisManaged RedisMicrosoft now steers new work to Azure Managed Redis and has announced retirement dates for the older tiers: check the docsRate limits, cached balances for displayElastiCacheMemorystore

Messaging

Part 4 of 6 · three services, three different jobs

Service Bus, Event Grid, Event Hubs

Messaging

A message is a command someone must handle. An event is a fact that something happened. A stream is a replayable log of many events.

ServiceCarriesDeliveryOrder and replayAWSGCP
Service BusMessages: "make this transfer"Pull, peek-lock, at least once, dead-letter queueFIFO with sessions; gone once completedSQS + SNS, Amazon MQPub/Sub
Event GridDiscrete events: "blob created"Push to a webhook, function or queue, with retriesNo order; no replayEventBridge, S3 notificationsEventarc
Event HubsStreams: every click, every log lineConsumers read partitions and keep their own offsetOrdered per partition; replay within retentionKinesis Data Streams, MSKPub/Sub, Managed Service for Apache Kafka

Choosing one

Messaging

Ask what is being sent and what happens if it is lost.

They combine: Event Grid can deliver a "blob created" event into a Service Bus queue for reliable handling.

Service Bus: queues, topics, dead-letter

Messaging

A queue has one logical consumer. A topic copies each message into every subscription whose filter matches, and each subscription then behaves like a queue. Every queue and subscription has its own dead-letter queue.

Each return to Active raises the delivery count. At the maximum (10 by default) the broker dead-letters the message.
FeatureWhat it doesAWS (SQS, SNS)GCP (Pub/Sub)
Peek-lockHides the message while one consumer works on itVisibility timeoutAck deadline
Dead-letter queueBuilt-in sub-queue for poison messagesA second queue plus a redrive policyDead-letter topic
SessionsFIFO per session id, one consumer per sessionFIFO message group idOrdering key
Duplicate detectionDrops a repeated MessageId inside a time windowFIFO deduplication idExactly-once delivery on pull subscriptions (a different mechanism)
Subscription filtersSQL or correlation rules on message propertiesSNS filter policySubscription filter
Scheduled messagesVisible only after a given timeDelay, up to about 15 minutesNot built in: Cloud Tasks

Trap: delivery is at least once. If the worker commits the transfer and crashes before it completes the message, the message comes back. Store the transfer id with a unique constraint so the second attempt is a no-op.

Network and operations

Part 5 of 6 · reach, visibility, secrets, money

Virtual networks, subnets, NSGs

Network and operations

A VNet is a private address space in one region. Subnets carve it up, a network security group (NSG) filters traffic at a subnet or network card, and a private endpoint gives a managed service a private IP inside a subnet.

One VNet, three subnets. The database has no public address at all.
TopicAzureAWSGCP
Network scopeVNet is regionalVPC is regionalVPC is global
Subnet scopeSpans all zones in the regionOne zone per subnetRegional, spans zones
FirewallNSG: stateful, allow and deny, priority 100 to 4096, lowest number winsSecurity group (stateful, allow only) plus network ACL (stateless)VPC firewall rules: stateful, allow and deny, priority
Private path to a servicePrivate endpoint (Private Link)Interface endpoint (PrivateLink)Private Service Connect
Connect networksVNet peering, Virtual WANVPC peering, Transit GatewayVPC peering, Shared VPC
OutboundNAT GatewayNAT gatewayCloud NAT

Trap: a new NSG already allows all traffic inside the VNet and all outbound traffic (default rules at priority 65000 and up). "Private subnet" means nothing until you add deny rules. Also, some services offer private endpoints only on higher tiers, Service Bus Premium for one.

Load Balancer, Application Gateway, Front Door

Network and operations

Two questions pick the service: is the traffic HTTP, and is the entry point one region or the whole world.

Layer 7 on the left, layer 4 on the right. Front Door in front of a regional gateway is a common pair.
AzureLayer and reachAddsAWSGCP
Load Balancer4, regionalHealth probes, zone redundancyNetwork Load BalancerPassthrough Network Load Balancer
Application Gateway7, regionalTLS termination, path routing, WAFApplication Load Balancer + WAFRegional Application Load Balancer + Cloud Armor
Front Door7, global edgeAnycast, caching, WAF, failover between regionsCloudFront + Global AcceleratorGlobal Application Load Balancer + Cloud CDN
Traffic ManagerDNS, globalRouting by latency, priority or weightRoute 53 routing policiesCloud DNS routing policies

Container Apps and App Service already include a regional HTTP ingress, so a small API needs none of these until it wants a WAF or a second region.

Azure Monitor

Network and operations

Azure Monitor is the umbrella. Metrics are stored for you, logs go to a Log Analytics workspace that you query with KQL, and Application Insights is the application view (requests, dependencies, traces) on top of a workspace.

Resource logs are not collected until a diagnostic setting sends them somewhere.
AzureHoldsAWSGCP
Azure Monitor MetricsNumeric time series, about 93 daysCloudWatch MetricsCloud Monitoring
Log Analytics workspaceLogs in tables, queried with KQLCloudWatch Logs + Logs InsightsCloud Logging + Log Analytics
Application InsightsRequests, dependencies, exceptions, tracesX-Ray, Application SignalsCloud Trace, Error Reporting
Activity logWho changed which resourceCloudTrailCloud Audit Logs
Alert rule + action groupCondition, and who to tellCloudWatch alarm + SNSAlerting policy + notification channel

More on the three signals in Observability.

Key Vault

Network and operations

Key Vault stores three kinds of object behind one access model. The app reads them with its managed identity, as in the token sequence above.

ObjectExampleAWSGCP
SecretA partner API keySecrets Manager, Parameter StoreSecret Manager
KeyEncryption key that never leaves the vaultKMSCloud KMS
CertificateTLS certificate with auto-renewalCertificate Manager (ACM)Certificate Manager
Soft delete, purge protectionDeleted items recoverable for 7 to 90 daysRecovery window, key deletion waiting periodSecret version disable, key destroy delay

Rule: the best secret is the one that does not exist. Use managed identity for Azure SQL, Storage and Service Bus, and keep Key Vault for things that cannot use Entra: third-party API keys, signing keys, certificates.

Cost control

Network and operations

Cost follows three things: what is running, what is stored, and what leaves the region. Tag everything with an owner and an environment on day one.

LeverAzureAWSGCP
See the billCost Management: cost analysis by tag, group, serviceCost ExplorerBilling reports
Get warnedBudgets with alertsAWS BudgetsBudgets and alerts
Commit for a discountReservations, savings plan (1 or 3 years)Reserved Instances, Savings PlansCommitted use discounts
Pay nothing when idleContainer Apps and Functions to zero, SQL serverless auto-pauseLambda, Aurora ServerlessCloud Run, Cloud Run functions

Trap: a budget only sends alerts. It does not stop anything unless you wire its action group to automation. The usual surprise lines are log ingestion, NAT and egress data, and idle gateways.

The bank API on Azure

Part 6 of 6 · one reference design, then the quick lists

Reference architecture

The bank API on Azure

An API and a worker on Container Apps, the ledger in Azure SQL, transfers handed over through a Service Bus queue. Every arrow between Azure services is authenticated with a managed identity.

Solid lines are the request path. Dotted lines are support: failures, secrets, telemetry.
PieceAzure choiceAWSGCP
EdgeFront Door + WAFCloudFront + WAFGlobal load balancer + Cloud Armor
APIContainer app, 2 to 10 replicas, zone-redundantECS service on FargateCloud Run service
WorkerContainer app, 0 to N on queue lengthECS service scaled on SQS depthCloud Run with a Pub/Sub push
LedgerAzure SQL, General Purpose, zone-redundant, private endpointRDS Multi-AZCloud SQL HA
Hand-offService Bus queue, duplicate detection onSQS FIFO + DLQPub/Sub + dead-letter topic
StatementsBlob Storage, ZRS, lifecycle policyS3Cloud Storage
IdentityOne user-assigned managed identity per appTask roleService account

One transfer, end to end

The bank API on Azure

Rishikesh sends 500 to Sandhya. The API accepts the request quickly and the worker moves the money, so a slow or failing step is retried without the client waiting.

The client's idempotency key becomes the MessageId, so a retried POST does not queue a second transfer.
FailureWhat saves youAWSGCP
Client retries the POSTDuplicate detection on MessageId, unique key in SQLFIFO deduplication idUnique key in the database
API crashes between insert and sendOutbox table: a relay sends PENDING rowsSame patternSame pattern
Worker crashes mid-transferLock expires, message is redeliveredVisibility timeoutAck deadline
Message can never succeedDead-letter queue plus an alert on its lengthDLQ + CloudWatch alarmDead-letter topic + alert

Cheat sheet: az commands

The bank API on Azure · Not run for this page: no Azure account. Flags checked against az ... --help.

The shape is always az <group> <subgroup> <verb>. Add --output table to read, --query (JMESPath) to pick fields, --help on anything.

Cheat sheet: the service map

The bank API on Azure

Most of Azure is a rename of something you already know. The matches are "closest", not identical.

NeedAzureAWSGCP
IdentityMicrosoft Entra IDIAM, IAM Identity CenterCloud Identity, IAM
Virtual machinesVirtual Machines, Scale SetsEC2, Auto ScalingCompute Engine, MIGs
Serverless containersContainer AppsECS on Fargate, App RunnerCloud Run
KubernetesAKSEKSGKE
FunctionsAzure FunctionsLambdaCloud Run functions
Image registryContainer Registry (ACR)ECRArtifact Registry
Object storageBlob StorageS3Cloud Storage
Relational databaseAzure SQL, PostgreSQL Flexible ServerRDS, AuroraCloud SQL, AlloyDB
NoSQLCosmos DBDynamoDBFirestore, Bigtable
CacheAzure Cache for RedisElastiCacheMemorystore
Queue and pub/subService BusSQS, SNSPub/Sub
Event routingEvent GridEventBridgeEventarc
StreamingEvent HubsKinesis Data Streams, MSKPub/Sub, Managed Kafka
NetworkVirtual Network (VNet)VPCVPC
Secrets and keysKey VaultSecrets Manager, KMSSecret Manager, Cloud KMS
MonitoringAzure MonitorCloudWatchCloud Monitoring, Cloud Logging
Infrastructure as codeBicep, ARM templatesCloudFormation, CDKInfrastructure Manager (Terraform)

Interview questions

The bank API on Azure

QuestionShort answer
Subscription versus resource group?A subscription is the billing, quota and isolation boundary. A resource group is a lifecycle container inside it: deploy together, delete together.
Entra roles versus Azure RBAC roles?Entra roles manage the directory (users, apps). RBAC roles manage resources at a scope. They are assigned separately.
Why can a Contributor not read a blob?Contributor has control-plane Actions only. Reading data with Entra needs a role with DataActions, such as Storage Blob Data Reader.
System-assigned or user-assigned identity?System-assigned for one resource with its own lifecycle. User-assigned when several resources share it, or when roles must exist before the app is deployed.
Container Apps or AKS?Container Apps unless you need the Kubernetes API itself: operators, custom networking, a shared platform. AKS costs upgrade and node work.
Service Bus, Event Grid or Event Hubs?Commands that must be processed: Service Bus. Reacting to discrete events: Event Grid. High-volume replayable streams: Event Hubs.
What sends a message to the dead-letter queue?Exceeding the maximum delivery count, an explicit dead-letter call, or TTL expiry if that option is on. Alert on its length.
NSG versus AWS security group?Both stateful. An NSG has allow and deny rules with priorities and attaches to a subnet or a network card. A security group is allow-only and attaches to an interface.
How would you survive a region outage?Second region behind Front Door, SQL failover group, geo-redundant storage, Service Bus geo-recovery. State the recovery time and data loss you accept, then test the failover.

The same map for the other two clouds: AWS and GCP. Back to Cloud and DevOps.