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
Every resource sits in exactly one resource group, inside one subscription, under one tenant. Policy and access set at a higher level flow down.
| Azure level | What it is for | AWS | GCP |
|---|---|---|---|
| Tenant | One Microsoft Entra ID directory: users, groups, apps | Organization + IAM Identity Center | Organization + Cloud Identity |
| Management group | Group subscriptions for policy and access | Organizational unit (OU) | Folder |
| Subscription | Billing, quota and isolation boundary | Account | Project |
| Resource group | Things deployed and deleted together | No real match: tags, or a CloudFormation stack | No real match: labels (a project is often used this way) |
| Azure Policy | Rules such as "only these regions" | Service control policies, Config rules | Organization 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
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.
| Azure term | Meaning | AWS | GCP |
|---|---|---|---|
| Region | Where the resource runs | Region | Region |
| Availability zone | Separate power, cooling, network | Availability Zone | Zone |
| Region pair | Built-in partner for geo-replication | None: you choose a second region | None: dual and multi-regions for storage |
| LRS, ZRS, GRS, GZRS | Storage copies: one datacenter, three zones, plus the pair | S3 is multi-AZ by default; cross-region replication | Regional, 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
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 object | What it is | AWS | GCP |
|---|---|---|---|
| User, group | People, and sets of people | Identity Center user, group | Google account, group |
| Service principal | That application's identity inside one tenant | IAM role (or IAM user with keys) | Service account |
| Managed identity | A service principal whose credentials Azure rotates | IAM role on a resource | Attached 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
Access is a role assignment: one principal, one role definition, one scope. Assignments only add permissions, and they are inherited by every scope below.
| Concept | Azure | AWS | GCP |
|---|---|---|---|
| Permission set | Role definition: Actions, DataActions | IAM policy document | Role (a list of permissions) |
| Grant | Role assignment at a scope | Policy attached to a role, user or resource | Role binding in an allow policy |
| Scopes | Management group, subscription, resource group, resource | Account; resource ARNs inside the policy | Organization, folder, project, resource |
| Explicit deny | Not in assignments (deny assignments are system-made) | Yes, Deny wins | Deny policies |
| Broad roles | Owner, Contributor, Reader | AdministratorAccess, PowerUserAccess, ReadOnlyAccess | Owner, 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
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.
| Identity | Credential | Use it for | AWS | GCP |
|---|---|---|---|---|
| System-assigned managed identity | None you can see; dies with the resource | One app, one identity | Instance profile, task role | Attached service account |
| User-assigned managed identity | None you can see; its own resource | Shared by several apps, survives redeploys | One IAM role used by many | One service account used by many |
| Service principal + federated credential | Trusts an external OIDC token | GitHub Actions, another cloud | IAM role with an OIDC provider | Workload Identity Federation |
| Service principal + secret or certificate | You store and rotate it | Last resort | IAM user access keys | Service 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
Pick the highest level of abstraction that still fits. Each step down buys control and costs operations work.
| Service | You manage | Scaling | AWS | GCP |
|---|---|---|---|---|
| Virtual Machines, Scale Sets | OS, patches, runtime, app | Scale set rules, minutes | EC2, Auto Scaling groups | Compute Engine, MIGs |
| App Service | Code or one container | Instances of a plan; deployment slots for swaps | Elastic Beanstalk, App Runner | App Engine |
| Container Apps | Image and scale rules | 0 to N replicas on HTTP or queue length | ECS on Fargate, App Runner | Cloud Run |
| AKS | Node pools, add-ons, upgrades, manifests | Pods and nodes | EKS | GKE |
| Functions | A function and its trigger | Per event, to zero on consumption plans | Lambda | Cloud 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
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.
| Tier | Minimum stay (approx.) | Read | AWS S3 | GCP Cloud Storage |
|---|---|---|---|---|
| Hot | None | Milliseconds | Standard | Standard |
| Cool | 30 days | Milliseconds, per-GB read fee | Standard-IA | Nearline |
| Cold | 90 days | Milliseconds, higher read fee | Glacier Instant Retrieval | Coldline |
| Archive | 180 days | Offline: rehydrate first, up to hours | Glacier Flexible Retrieval, Deep Archive | Archive (still online) |
The policy in the figure. Not run for this page; field names checked against the storage management SDK model.
SAS tokens
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.
| SAS type | Signed with | Revoke by | AWS | GCP |
|---|---|---|---|---|
| User delegation SAS | A key obtained with an Entra token (max about 7 days) | Revoking the delegation keys, or removing the role | Presigned URL from role credentials | Signed URL from a service account |
| Service SAS | Storage account key | Stored access policy, or rotating the key | Presigned URL from user keys | Signed 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
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.
| Choice | Options | Pick when | AWS | GCP |
|---|---|---|---|---|
| Deployment | SQL Database, SQL Managed Instance, SQL Server on a VM | New app; lift and shift; full OS control | RDS for SQL Server; RDS Custom; EC2 | Cloud SQL for SQL Server; Compute Engine |
| Compute | Provisioned or serverless (auto-pause) | Serverless for dev and spiky load | Aurora Serverless (closest) | No close match |
| Tier | General Purpose, Business Critical, Hyperscale | Default; low latency plus a read replica; very large | RDS Multi-AZ; Aurora | Cloud SQL HA; AlloyDB |
| Geo failover | Failover group | Regional disaster recovery | Cross-region read replica | Cross-region replica |
| Login | Entra ID (managed identity) or SQL login | Entra, so there is no password | IAM database authentication | IAM 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
Three more stores cover most backend needs. Start with a relational database and add the others for a reason.
| Service | Model | Know this | Bank use | AWS | GCP |
|---|---|---|---|---|---|
| Cosmos DB | Partitioned JSON documents, global distribution | Billed in request units; partition key is forever; five consistency levels from strong to eventual | Activity feed, sessions | DynamoDB | Firestore, Bigtable |
| PostgreSQL Flexible Server | Managed PostgreSQL | Zone-redundant standby, read replicas, built-in PgBouncer | The ledger, if the team prefers Postgres | RDS for PostgreSQL | Cloud SQL for PostgreSQL |
| Azure Cache for Redis | Managed Redis | Microsoft now steers new work to Azure Managed Redis and has announced retirement dates for the older tiers: check the docs | Rate limits, cached balances for display | ElastiCache | Memorystore |
Messaging
Part 4 of 6 · three services, three different jobs
Service Bus, Event Grid, Event Hubs
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.
| Service | Carries | Delivery | Order and replay | AWS | GCP |
|---|---|---|---|---|---|
| Service Bus | Messages: "make this transfer" | Pull, peek-lock, at least once, dead-letter queue | FIFO with sessions; gone once completed | SQS + SNS, Amazon MQ | Pub/Sub |
| Event Grid | Discrete events: "blob created" | Push to a webhook, function or queue, with retries | No order; no replay | EventBridge, S3 notifications | Eventarc |
| Event Hubs | Streams: every click, every log line | Consumers read partitions and keep their own offset | Ordered per partition; replay within retention | Kinesis Data Streams, MSK | Pub/Sub, Managed Service for Apache Kafka |
Choosing one
Ask what is being sent and what happens if it is lost.
Service Bus: queues, topics, dead-letter
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.
| Feature | What it does | AWS (SQS, SNS) | GCP (Pub/Sub) |
|---|---|---|---|
| Peek-lock | Hides the message while one consumer works on it | Visibility timeout | Ack deadline |
| Dead-letter queue | Built-in sub-queue for poison messages | A second queue plus a redrive policy | Dead-letter topic |
| Sessions | FIFO per session id, one consumer per session | FIFO message group id | Ordering key |
| Duplicate detection | Drops a repeated MessageId inside a time window | FIFO deduplication id | Exactly-once delivery on pull subscriptions (a different mechanism) |
| Subscription filters | SQL or correlation rules on message properties | SNS filter policy | Subscription filter |
| Scheduled messages | Visible only after a given time | Delay, up to about 15 minutes | Not 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
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.
| Topic | Azure | AWS | GCP |
|---|---|---|---|
| Network scope | VNet is regional | VPC is regional | VPC is global |
| Subnet scope | Spans all zones in the region | One zone per subnet | Regional, spans zones |
| Firewall | NSG: stateful, allow and deny, priority 100 to 4096, lowest number wins | Security group (stateful, allow only) plus network ACL (stateless) | VPC firewall rules: stateful, allow and deny, priority |
| Private path to a service | Private endpoint (Private Link) | Interface endpoint (PrivateLink) | Private Service Connect |
| Connect networks | VNet peering, Virtual WAN | VPC peering, Transit Gateway | VPC peering, Shared VPC |
| Outbound | NAT Gateway | NAT gateway | Cloud 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
Two questions pick the service: is the traffic HTTP, and is the entry point one region or the whole world.
| Azure | Layer and reach | Adds | AWS | GCP |
|---|---|---|---|---|
| Load Balancer | 4, regional | Health probes, zone redundancy | Network Load Balancer | Passthrough Network Load Balancer |
| Application Gateway | 7, regional | TLS termination, path routing, WAF | Application Load Balancer + WAF | Regional Application Load Balancer + Cloud Armor |
| Front Door | 7, global edge | Anycast, caching, WAF, failover between regions | CloudFront + Global Accelerator | Global Application Load Balancer + Cloud CDN |
| Traffic Manager | DNS, global | Routing by latency, priority or weight | Route 53 routing policies | Cloud 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
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.
| Azure | Holds | AWS | GCP |
|---|---|---|---|
| Azure Monitor Metrics | Numeric time series, about 93 days | CloudWatch Metrics | Cloud Monitoring |
| Log Analytics workspace | Logs in tables, queried with KQL | CloudWatch Logs + Logs Insights | Cloud Logging + Log Analytics |
| Application Insights | Requests, dependencies, exceptions, traces | X-Ray, Application Signals | Cloud Trace, Error Reporting |
| Activity log | Who changed which resource | CloudTrail | Cloud Audit Logs |
| Alert rule + action group | Condition, and who to tell | CloudWatch alarm + SNS | Alerting policy + notification channel |
More on the three signals in Observability.
Key Vault
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.
| Object | Example | AWS | GCP |
|---|---|---|---|
| Secret | A partner API key | Secrets Manager, Parameter Store | Secret Manager |
| Key | Encryption key that never leaves the vault | KMS | Cloud KMS |
| Certificate | TLS certificate with auto-renewal | Certificate Manager (ACM) | Certificate Manager |
| Soft delete, purge protection | Deleted items recoverable for 7 to 90 days | Recovery window, key deletion waiting period | Secret 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
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.
| Lever | Azure | AWS | GCP |
|---|---|---|---|
| See the bill | Cost Management: cost analysis by tag, group, service | Cost Explorer | Billing reports |
| Get warned | Budgets with alerts | AWS Budgets | Budgets and alerts |
| Commit for a discount | Reservations, savings plan (1 or 3 years) | Reserved Instances, Savings Plans | Committed use discounts |
| Pay nothing when idle | Container Apps and Functions to zero, SQL serverless auto-pause | Lambda, Aurora Serverless | Cloud 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
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.
| Piece | Azure choice | AWS | GCP |
|---|---|---|---|
| Edge | Front Door + WAF | CloudFront + WAF | Global load balancer + Cloud Armor |
| API | Container app, 2 to 10 replicas, zone-redundant | ECS service on Fargate | Cloud Run service |
| Worker | Container app, 0 to N on queue length | ECS service scaled on SQS depth | Cloud Run with a Pub/Sub push |
| Ledger | Azure SQL, General Purpose, zone-redundant, private endpoint | RDS Multi-AZ | Cloud SQL HA |
| Hand-off | Service Bus queue, duplicate detection on | SQS FIFO + DLQ | Pub/Sub + dead-letter topic |
| Statements | Blob Storage, ZRS, lifecycle policy | S3 | Cloud Storage |
| Identity | One user-assigned managed identity per app | Task role | Service account |
One transfer, end to end
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.
MessageId, so a retried POST does not queue a second transfer.| Failure | What saves you | AWS | GCP |
|---|---|---|---|
| Client retries the POST | Duplicate detection on MessageId, unique key in SQL | FIFO deduplication id | Unique key in the database |
| API crashes between insert and send | Outbox table: a relay sends PENDING rows | Same pattern | Same pattern |
| Worker crashes mid-transfer | Lock expires, message is redelivered | Visibility timeout | Ack deadline |
| Message can never succeed | Dead-letter queue plus an alert on its length | DLQ + CloudWatch alarm | Dead-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
Most of Azure is a rename of something you already know. The matches are "closest", not identical.
| Need | Azure | AWS | GCP |
|---|---|---|---|
| Identity | Microsoft Entra ID | IAM, IAM Identity Center | Cloud Identity, IAM |
| Virtual machines | Virtual Machines, Scale Sets | EC2, Auto Scaling | Compute Engine, MIGs |
| Serverless containers | Container Apps | ECS on Fargate, App Runner | Cloud Run |
| Kubernetes | AKS | EKS | GKE |
| Functions | Azure Functions | Lambda | Cloud Run functions |
| Image registry | Container Registry (ACR) | ECR | Artifact Registry |
| Object storage | Blob Storage | S3 | Cloud Storage |
| Relational database | Azure SQL, PostgreSQL Flexible Server | RDS, Aurora | Cloud SQL, AlloyDB |
| NoSQL | Cosmos DB | DynamoDB | Firestore, Bigtable |
| Cache | Azure Cache for Redis | ElastiCache | Memorystore |
| Queue and pub/sub | Service Bus | SQS, SNS | Pub/Sub |
| Event routing | Event Grid | EventBridge | Eventarc |
| Streaming | Event Hubs | Kinesis Data Streams, MSK | Pub/Sub, Managed Kafka |
| Network | Virtual Network (VNet) | VPC | VPC |
| Secrets and keys | Key Vault | Secrets Manager, KMS | Secret Manager, Cloud KMS |
| Monitoring | Azure Monitor | CloudWatch | Cloud Monitoring, Cloud Logging |
| Infrastructure as code | Bicep, ARM templates | CloudFormation, CDK | Infrastructure Manager (Terraform) |
Interview questions
| Question | Short 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.