Microsoft Cloud Adoption Framework for Azure (CAF)

The Microsoft Cloud Adoption Framework for Azure (CAF) is a comprehensive set of documentation, guidance, best practices, and tools designed to help organizations create and implement cloud strategies that align business goals with technical execution.

While Azure technical tools handle how services run, CAF provides the operational and architectural blueprint for how an enterprise safely moves to and operates in the cloud.

The 6 Lifecycle Phases of CAF

1. Strategy

Define the business motivation behind moving to the cloud to prevent technology-first decisions without clear ROI.

  • Financial Model: Compare On-Premises CapEx against Cloud OpEx, factoring in Azure Hybrid Benefit and Reserved Instances.
  • Business Outcomes: Define concrete metrics (e.g., market expansion time, risk reduction, operational agility).
2. Plan

Align people, processes, and existing IT estates to the migration goals.

  • Digital Estate Inventory: Categorize workloads using the 5 Rs of Rationalization (Rehost, Refactor, Rearchitect, Replatform, Replace/Retire).
  • Organizational Alignment: Transition traditional siloed teams into a Cloud Center of Excellence (CCoE) or dedicated Platform/DevOps teams.
3. Ready

Prepare the Azure environment to host workloads securely before migration begins.

  • Azure Landing Zones: Deploy standardized, enterprise-scale subscription structures (Management Groups, Subscription topology, Hub-and-Spoke networks, Entra ID integration).
  • Infrastructure as Code (IaC): Use Terraform, Bicep, or ARM templates to enforce repeatable baseline environments.
4. Adopt

Execute the technical workloads strategy through two primary tracks:

  • Migration: Iterative execution of workload migration waves (using tools like Azure Migrate).
  • Innovation: Building new cloud-native applications using microservices, PaaS services, serverless, and AI primitives.
5. Govern

Establish operational guardrails across subscriptions to manage risk and compliance continuously.

  • Cost Management (FinOps): Implement budget limits, auto-shutdowns, and automated tagging rules.
  • Security & Policy Baselines: Apply Azure Policy rules enterprise-wide to block non-compliant resources in real time.
6. Manage

Deliver ongoing operations and service management post-migration.

  • Operations Baseline: Ensure continuous logging (Azure Monitor), patch management, and automated backup regimes (Azure Backup).
  • Resiliency & Recovery: Configure Business Continuity and Disaster Recovery (BCDR) using Azure Site Recovery (ASR).

##CAF Tools & Accelerators

ToolPurpose
Azure Architecture Review / CAF AssessmentInteractive tool to evaluate business strategy, landing zone readiness, and governance posture.
Enterprise-Scale Landing Zone TemplatesOfficial Bicep / Terraform reference implementations for deploying root management group hierarchies.
Azure DevOps / GitHub CAF BoardsPre-built backlog templates to manage Cloud Adoption projects inside standard agile workflows.

Large scale migrations

Migrating 6,000 Virtual Machines (VMs) to Azure moves you out of standard “lift-and-shift” operations and into large-scale cloud transformation. At this scale, manual or piecemeal approaches fail due to operational bottlenecks, bandwidth limitations, and business disruption.

The industry standard for large-scale migrations follows the Microsoft Cloud Adoption Framework (CAF), structured around four primary phases.

Architecture Phase Overview

 ┌──────────────────┐    ┌──────────────────┐    ┌──────────────────┐    ┌──────────────────┐
 │  1. DISCOVERY    │ ──►│   2. WAVE        │ ──►│   3. MIGRATION   │ ──►│  4. GOVERNANCE   │
 │   & ASSESSMENT   │    │    PLANNING      │    │    EXECUTION     │    │   & MONITORING   │
 └──────────────────┘    └──────────────────┘    └──────────────────┘    └──────────────────┘
   • Azure Migrate         • App Grouping          • Azure Migrate        • FinOps Cost Mgmt
   • RVTools Analysis      • Move Groups           • ExpressRoute Setup   • Defender for Cloud
   • TCO Modeling          • Network Mapping       • Automated Cutover    • Policy Enforcement

1. Discovery & Automated Assessment

At 6,000 VMs, automated tooling is essential to discover dependencies, right-size compute, and estimate total cost of ownership (TCO).

  • Deploy Azure Migrate Appliances: Deploy multiple agentless Azure Migrate appliances across your vSphere/Hyper-V infrastructure to continuously collect performance metrics (CPU, RAM, disk IOPS, network utilization).
  • Dependency Mapping: Use agentless or agent-based dependency analysis to group interconnected workloads. Never migrate a database without mapping its dependent application servers first.
  • Right-Sizing & Reserved Instances: Base sizing recommendations on performance-based data rather than static VM allocations. Calculate cost models using 3-Year Azure Reserved Instances (RIs) or Savings Plans, alongside Azure Hybrid Benefit (AHUB) for existing Windows Server and SQL licenses.

2. Landing Zone Foundations & Wave Planning

Before moving a single production workload, establish an enterprise-scale Azure Landing Zone.

                           ┌─────────────────────────────────┐
│ Tenant Root Group │
└────────────────┬────────────────┘
│
┌────────────▼────────────┐
│ Management Group │
└────────────┬────────────┘
│
┌────────────────────────────────┼────────────────────────────────┐
▼ ▼ ▼
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ Platform Management │ │ Identity & Auth │ │ Connectivity (Hub) │
│ • Azure Monitor │ │ • Domain Controllers│ │ • ExpressRoute │
│ • Log Analytics │ │ • Entra ID Connect │ │ • Azure Firewall │
└─────────────────────┘ └─────────────────────┘ └─────────────────────┘
Wave Planning & Categorization

Divide the 6,000 VMs into structured migration waves using the 6 Rs framework:

Migration StrategyTarget %Criteria
Rehost (Lift-and-Shift)60%–70%Legacy OS, monolithic apps, off-the-shelf software (ISV).
Replatform (Lift & Reshape)15%–20%Move SQL Server VMs to Azure SQL Managed Instance or Azure SQL DB.
Retire / Retain10%–15%Decommission unused VMs identified during discovery scans.
Refactor< 5%High-value internal apps converted to containers (AKS) or App Services.
Bandwidth & Rehydration Sizing

Transferring petabytes of data requires dedicated hybrid connectivity:

  • Connectivity: Establish dual Azure ExpressRoute circuits (10 Gbps) in an active-active, geographically redundant configuration.
  • Offline Data Transfer: For non-time-sensitive data stores, leverage Azure Data Box devices to perform initial seed transfers offline.

3. Migration Execution Engine

Executing a 6,000 VM migration requires automation and factory-style execution.

1.Establish Infrastructure & Waves:Prep Phase.

  1. Deploy Azure Landing Zone (Hub-and-Spoke network topology, ExpressRoute, Azure Policy).
  2. Define target wave sizes (typically 100–300 VMs per migration weekend).
  3. Validate DNS resolution and Active Directory replication between on-premises and Azure.

2.Initial & Continuous Data Sync:Replication Phase.

  1. Enable initial agentless block-level replication using Azure Migrate.
  2. Monitor bandwidth throttling across ExpressRoute to prevent impacting production on-premises workloads.
  3. Allow continuous delta sync to keep target Azure managed disks up to date prior to cutover.

3.Non-Disruptive Migration Rehearsal:Testing Phase.

  1. Perform Test Migrations on isolated, non-routed target Virtual Networks (VNets).
  2. Validate application functionality, service start behaviors, and database connection strings.
  3. Remediate missing drivers or network configuration issues before scheduling cutover.

4.Final Sync & System Cutover:Cutover Phase.

  1. Shut down source VMs on-premises to guarantee data quiescence.
  2. Trigger final delta synchronization in Azure Migrate.
  3. Provision and boot target Azure VMs, update internal DNS records, and run validation scripts.

4. Post-Migration Governance & Day-2 Operations

Once workloads arrive in Azure, shift immediately into operational governance:

  1. FinOps Cost Optimization:
    • Enable Azure Cost Management and set budget alerts at the Subscription and Resource Group levels.
    • Auto-shutdown non-production VMs outside business hours.
    • Apply Reserved Instances or Savings Plans immediately post-cutover.
  2. Security & Posture Management:
    • Onboard target subscriptions into Microsoft Defender for Cloud.
    • Enforce Azure Policy baselines (e.g., restrict public IPs, force encryption on managed disks, require specific tags).
  3. Backup & Disaster Recovery:
    • Enable Azure Backup with automated Vault policies.
    • Configure Azure Site Recovery (ASR) for critical workloads needing cross-region disaster recovery.

Internal Developer Platform (IDP)

An Internal Developer Platform (IDP) bridges the gap between raw infrastructure primitives and developer velocity. The platform’s primary job is to establish “Golden Paths”—pre-approved, automated, self-service workflows that allow developers to provision infrastructure, run microservices, and manage environments without needing deep Kubernetes or Cloud expertise.

Below is an architectural blueprint for an IDP powered by Backstage, Terraform, GitHub Actions, ArgoCD, and Kubernetes.


1. High-Level Architectural Topology

2. Core Platform Components & Layering

Layer 1: Developer Interaction (Backstage)
  • Software Catalog & Templates: Developers choose from predefined “Golden Path” templates (e.g., Create New Node.js Service with PostgreSQL).
  • Scaffolder: Collects parameters (App Name, Region, Database Size) and auto-generates a new GitHub repository populated with application code, Helm/Kustomize charts, and Terraform definitions.
Layer 2: Pipeline & Provisioning Engine (GitHub Actions & Terraform)
  • Infrastructure Pipeline: Runs terraform plan on Pull Requests and terraform apply on merges to provision cloud-native dependencies (e.g., Azure Database for PostgreSQL, AWS S3, IAM Roles).
  • Workload Identity Federation (OIDC): Authenticates GitHub Actions directly to cloud providers and Kubernetes without storing static credentials or access keys.
Layer 3: Application Delivery & State Reconciliation (ArgoCD & Kubernetes)
  • GitOps Controller: ArgoCD monitors application manifest repositories. When GitHub Actions pushes a updated Helm chart or image tag, ArgoCD automatically reconciles state in the Kubernetes cluster.
  • Environment Isolation: Uses Kubernetes Namespaces augmented with NetworkPolicies, ResourceQuotas, and LimitRanges to provide multi-tenant team isolation.

3. End-to-End Self-Service Workflow Sequence

1.Template Selection in Portal:Developer Action.

  1. A developer logs into Backstage and selects the “New Microservice” catalog template.
  2. They fill out a form providing parameters:
    • App Name: payment-service
    • Language: Go
    • Database Required: Yes (PostgreSQL)
    • Environment: Staging

2.Repository Scaffolding:Portal Orchestration.

  1. Backstage executes the template engine, creating a target GitHub repository: org/payment-service.
  2. It populates the repository with:
    • Base application skeleton code.
    • A /terraform directory with pre-approved modules for RDS/PostgreSQL.
    • A /helm chart for Kubernetes deployment.
    • A .github/workflows/deploy.yml pipeline.
  3. Backstage registers the new entity in its software catalog and registers the deployment with ArgoCD.

3.Infrastructure Provisioning via Terraform:CI/CD & IaC Execution.

  1. GitHub Actions triggers the initial workflow.
  2. It authenticates to the Cloud Provider via OIDC.
  3. Runs terraform apply inside /terraform to spin up the isolated cloud database, creating an output secret in HashiCorp Vault or Azure Key Vault / AWS Secrets Manager.

4.Kubernetes Deployment via ArgoCD:GitOps Delivery.

  1. GitHub Actions builds the Docker container, scans it using Trivy, and pushes it to container registry.
  2. The workflow updates the /helm/values.yaml image tag parameter in Git.
  3. ArgoCD detects the commit and pulls the updated Helm chart, creating the deployment, service, ingress, and pod resources inside the team-payments namespace.

4. Key Engineering Guardrails & Governance

IaC & Terraform Governance
  • Module Registry: Force developers to consume pre-tested, platform-team-maintained Terraform modules via a private module registry rather than writing raw IaC.
  • Policy-as-Code: Run static security checks (checkov or tfsec) and policy validation (OPA / Sentinel) inside GitHub Actions before terraform apply executes.
Kubernetes Runtime Security
  • Pod Security Standards (PSS): Enforce restricted or baseline security profiles cluster-wide using Kyverno or OPA Gatekeeper.
  • Secret Injection: Never store raw database passwords in Git. Inject secrets into Kubernetes pods at runtime using External Secrets Operator (ESO) connected to AWS Secrets Manager or HashiCorp Vault.

5. Summary Matrix: Responsibility Partitioning

ComponentPlatform Team Role (Maintainers)Developer Team Role (Consumers)
Backstage PortalMaintains golden-path templates, UI plugins, catalog RBAC.Selects templates, views operational metrics, reads service docs.
Terraform CodeAuthors reusable, hardened modules (S3, VPC, DB).Supplies module inputs via Backstage forms (e.g., db_size = “small”).
GitHub ActionsOwns reusable global workflow templates and security scans.Triggers builds via standard git push or PRs.
Kubernetes ClusterOperates cluster infrastructure, ingress controllers, CNI, and ArgoCD.Configures runtime environment variables and application scaling params.

Platform Engineer, Senior DevOps/Infrastructure Engineer, or Cloud Architect, breakdown of how these technical domains map to real-world responsibilities

A Platform Engineer, Senior DevOps/Infrastructure Engineer, or Cloud Architect focusing on building internal developer platforms, automating infrastructure, and establishing cloud governance.

Here is a breakdown of how these technical domains map to real-world responsibilities and interview preparation areas:

Skill Set Breakdown & Key Focus Areas

1. Infrastructure as Code & Landing Zones

  • Terraform / OpenTofu: Modular architecture design, state file management (remote backends, state locking), workspace usage, custom provider integrations, and drift detection.
  • Landing Zones: Setting up enterprise cloud foundations (Azure Landing Zones / AWS Control Tower / GCP Landing Zones) emphasizing hub-and-spoke networking, policy assignment, and identity hierarchy.

2. Automation & CI/CD Pipelines

  • CI/CD Templates: Designing reusable, standardized pipeline templates (GitHub Actions workflow templates, GitLab CI templates, Azure DevOps pipeline templates) to promote uniform deployment practices across engineering teams.
  • Self-Service Infrastructure: Implementing GitOps workflows (e.g., via ArgoCD or Flux) or developer-facing CLI/UI tools to let developers provision pre-approved infrastructure on demand.

3. Multi-Cloud & Kubernetes

  • Cloud Platforms (Azure/AWS/GCP): Cross-cloud architecture, compute choices (VMs, serverless, managed containers), virtual networking, and private connectivity (ExpressRoute, Direct Connect, Private Endpoints).
  • Kubernetes (AKS / EKS / GKE): Cluster management, ingress controllers, service mesh architectures, Helm chart deployment, storage classes, and pod security standards.

4. Governance, Security & Observability

  • RBAC / IAM: Implementing least-privilege access models, workload identity federation (OIDC), conditional access, and privileged identity management (PIM).
  • Cloud Governance: Policy enforcement as code (Azure Policy, AWS SCPs, OPA/Gatekeeper) to enforce guardrails and cost management.
  • Observability: Centralized logging, metrics, and tracing using tools like Prometheus, Grafana, OpenTelemetry, Datadog, or cloud-native suites (Azure Monitor, AWS CloudWatch).

Suggested Interview Preparation Strategy

To position yourself effectively for this role, focus on framing your past experience around outcomes:

  1. Automation Impact: Quantify how self-service infrastructure reduced provisioning lead times (e.g., “Reduced developer onboarding time from weeks to 15 minutes by building a self-service Terraform/Backstage pipeline”).
  2. Security & Guardrails: Emphasize how governance was baked into the infrastructure rather than enforced manually.
  3. Platform Mindset: Treat developers as internal customers—demonstrate how your templates and platform features improved internal developer velocity while maintaining reliability.

Configuring security baselines for workloads in an Azure Landing Zone (ALZ)

Configuring security baselines for workloads in an Azure Landing Zone (ALZ) relies on policy-driven governance. Rather than manually configuring individual resources, you enforce security controls at the Management Group level using Azure Policy, Microsoft Defender for Cloud, and Infrastructure as Code (IaC) modules.

1. Implement Policy-Driven Guardrails

In an Enterprise-Scale Landing Zone, security baselines inherit automatically based on where a subscription sits in the Management Group hierarchy (Corp, Online, or Platform).

                    

Key Policy Definitions to Assign

Assign built-in policy initiatives (like the Microsoft cloud security benchmark (MCSB)) to the Intermediate Root Management Group:

  • Enforce Encryption in Transit: Block storage accounts or web apps that allow HTTP or TLS versions below 1.2 (Deny).
  • Disable Public Access: Prevent PaaS resources (SQL Server, Key Vault, Storage) from exposing public IP endpoints (Deny or Modify).
  • Auto-Provision Diagnostics: Stream all resource activity, audit, and diagnostic logs to the central Log Analytics workspace in the Management subscription using DeployIfNotExists (DINE) policies.

2. Deploy Automated Security via IaC (Bicep / Terraform)

When provisioning workload landing zones, use ALZ Bicep or Terraform modules to apply security baselines dynamically upon subscription creation.

Example: Bicep Policy Assignment for Security Baseline

Code snippet

targetScope = 'managementGroup'
param managementGroupId string = 'alz-landing-zones'
// Assign Microsoft Cloud Security Benchmark Initiative
resource mcsbAssignment 'Microsoft.Authorization/policyAssignments@2022-06-01' = {
name: 'mcsb-baseline-assignment'
scope: managementGroup(managementGroupId)
properties: {
displayName: 'Enforce Microsoft Cloud Security Benchmark'
description: 'Applies baseline security controls across all landing zone subscriptions.'
policyDefinitionId: '/providers/Microsoft.Authorization/policySetDefinitions/1f3afdf9-d0c9-4c3d-847f-89da613e70a8'
enforcementMode: 'Default'
}
}

3. Configure Microsoft Defender for Cloud at Scale

To ensure all workload subscriptions automatically inherit Defender plans:

  1. Enable Defender Plan Auto-Provisioning: Configure continuous policy assignments at the Management Group level so any new subscription placed in Corp or Online automatically enables plans for Servers, Containers, Databases, and Storage.
  2. Auto-Deploy Endpoint Protection: Enable auto-provisioning for Microsoft Defender for Endpoint extensions on all Linux and Windows VMs.
  3. Agentless Vulnerability Scanning: Activate agentless scanning for VMs and container registries across all subscriptions.

4. Operational Checklist for Workload Onboarding

1.Subscription Placement:Placement.

Move the workload subscription under the appropriate Management Group archetype (Corp for internal hybrid workloads, Online for internet-facing apps).

Verification: Verify that inherited policy assignments appear under Subscription > Policies.

2.Enforce Perimeter Isolation:Network.

Provision Private Endpoints for all PaaS services and attach a Network Security Group (NSG) to every subnet. Route outbound traffic through the Central Azure Firewall.

Verification: Ensure public network access is disabled on the resource overview blade in the portal.

3.Configure Managed Identities:Identity.

Configure System-Assigned or User-Assigned Managed Identities for app-to-service authentication, eliminating hardcoded keys or credentials.

Verification: Check Entra ID enterprise applications to confirm Managed Identity registration.

Securing cloud workloads

Securing cloud workloads (IaaS virtual machines, PaaS services, container clusters, and serverless functions) requires enforcing defense-in-depth across identity, network perimeter, data protection, and continuous threat monitoring.

Core Security Configurations by Layer

1. Identity & Access Management (IAM)
  • Least Privilege Access: Assign granular Role-Based Access Control (RBAC) roles at the resource group or specific resource scope. Avoid global Owner or Contributor assignments.
  • Workload Identities: Use managed identities (Azure Managed Identities, AWS IAM Roles for Service Accounts) for app-to-service authentication instead of embedding service principal credentials or hardcoded API keys.
  • Privileged Identity Management (PIM): Enforce Just-In-Time (JIT) access and multi-factor authentication (MFA) for administrative operations.
2. Network & Perimeter Controls
  • Private Connectivity: Disable public IP addresses on databases, key vaults, and internal backend services using Private Endpoints / Private Link.
  • Traffic Inspection: Route outbound internet-bound traffic through a central firewall (e.g., Azure Firewall, AWS Network Firewall) to enforce FQDN/URL filtering.
  • Micro-segmentation: Enforce stateful packet filtering using Network Security Groups (NSGs) or Kubernetes NetworkPolicies to restrict East-West traffic between subnets and pods.
3. Data Protection & Secrets Management
  • Encryption at Rest: Enforce Customer-Managed Keys (CMK) via key vaults for storage accounts, database disks, and backups.
  • Encryption in Transit: Mandate TLS 1.2 or TLS 1.3 across all endpoints and disable plain HTTP/unencrypted database connections.
  • Centralized Secrets Storage: Store connection strings, certificates, and tokens in dedicated secret vaults (e.g., Azure Key Vault, AWS Secrets Manager) with auto-rotation policies.
4. Vulnerability & Threat Protection
  • Continuous Scanning: Enable Cloud Workload Protection Platforms (CWPP)—such as Microsoft Defender for Cloud or Wiz—for real-time threat detection and vulnerability scanning.
  • Container Image Security: Integrate image scanning into CI/CD pipelines and container registries to block images with known CVEs from being deployed.
  • Automated Audit Logging: Stream control-plane Activity Logs and resource diagnostic logs to a central Log Analytics workspace or SIEM (e.g., Microsoft Sentinel).

Workload Baseline Configurations

Workload TypeBaseline Security Configurations
Virtual Machines (IaaS)Enable Disk Encryption; enforce Just-In-Time (JIT) SSH/RDP access; deploy EDR agents (e.g., Defender for Endpoint); disable public IPs.
Containers (AKS / EKS)Turn on RBAC; enforce OPA Gatekeeper / Azure Policy for Kubernetes; isolate control plane via private cluster endpoints; scan container images.
PaaS & Web AppsAttach Web Application Firewall (WAF); enforce custom domain TLS certificates; restrict IP inbound ranges to front-end proxies only.
Serverless FunctionsSet short execution timeouts; restrict IAM execution role permissions to explicit target resources; validate input payloads against injection attacks.

Azure Network Security Policy interview questions

Here are top Azure Network Security Policy interview questions spanning core components—including Network Security Groups (NSGs), Application Security Groups (ASGs), Azure Firewall, and Web Application Firewall (WAF)—structured by role level with key architectural takeaways.

1. Foundational & Core Security Policy Questions

Q1: What is the difference between an NSG, an ASG, and an Azure Firewall?
  • Network Security Group (NSG): A basic Layer 3/4 stateful packet-filtering firewall applied at the Subnet or Network Interface (NIC) level. It evaluates rules based on source/destination IP, port, and protocol.
  • Application Security Group (ASG): A logical grouping of VMs based on workload type or application role (e.g., ASG-Web, ASG-DB). ASGs are used within NSGs as source/destination abstractions so you don’t need to maintain individual static IP addresses in security rules.
  • Azure Firewall: A fully managed, stateful, cloud-native Layer 3–7 firewall service. It supports threat intelligence, FQDN/URL filtering, IDPS (Intrusion Detection and Prevention System), TLS inspection, and central routing across multiple VNets.
Q2: How are NSG rules evaluated when both Subnet-level and NIC-level NSGs are applied?
  • Inbound Traffic: The Subnet NSG evaluates traffic first. If allowed, the packet moves to the NIC NSG. Traffic is blocked if either NSG denies it.
  • Outbound Traffic: The NIC NSG evaluates traffic first. If allowed, the packet moves to the Subnet NSG.
  • Key Takeaway: Both NSGs must explicitly allow the traffic for communication to succeed.

Q3: Explain NSG Rule Priority and Default Rules.

  • Priority Range: Rules are processed in order of priority from 100 to 4096 (lower numbers take higher precedence).
  • Evaluation: Once a packet matches a rule’s criteria, rule processing stops (first match wins).
  • Default Rules (Priority 65000+): Cannot be deleted, but can be overridden by adding higher-priority rules (e.g., < 65000):
    • AllowVNetInBound (65000)
    • AllowAzureLoadBalancerInBound (65001)
    • DenyAllInBound (65500)

2. Advanced Architecture & Deep-Dives

Q4: How does Azure Firewall Manager manage security policies across enterprise landing zones?
  • Answer: Azure Firewall Manager centralizes security policy and route management across multiple Azure Firewalls and Virtual WAN Hubs.
  • Firewall Policies: Hierarchical objects containing Rule Collection Groups (DNAT, Network, and Application rule collections).
  • Inheritance Model: Allows a central SecOps team to enforce a Parent Policy (e.g., global threat-intel blocking and core logging) while allowing application teams to append region-specific or app-specific rules via Child Policies.
Q5: Compare Azure Firewall vs. Web Application Firewall (WAF) on Azure Front Door / Application Gateway.
  • Azure Firewall: Broad L3–L7 network/application firewall designed for non-HTTP/HTTPS traffic, outbound egress filtering, and cross-subnet/cross-VNet inspection.
  • Azure WAF: Specialized L7 reverse-proxy firewall designed exclusively for HTTP/HTTPS web applications. Protects against OWASP Top 10 risks (SQLi, XSS), bot attacks, and rate limiting using managed rule sets (CRS).
Q6: How do NSG Service Tags and Application Security Groups simplify rule management?
  • Service Tags: System-managed aliases representing IP address prefixes for specific Azure services (e.g., Storage, Sql, AzureKeyVault). They automatically update when Microsoft adjusts backend IP ranges, removing the need to manage dynamic public IPs manually.
  • ASGs: Decouple security configurations from network topology. Rather than writing rules targeting explicit static IP addresses (10.0.1.4), you write rules using ASGs (Allow ASG-Web to ASG-DB on port 1433).

3. Scenario-Based Architectural Questions

Q7: Scenario: Traffic between two subnets in the same VNet is failing, but the NSG allows port 443. How do you troubleshoot?
  1. Rule Evaluation Check: Check for a higher-priority NSG rule (e.g., Priority 200 Deny vs. Priority 300 Allow) overriding the rule.
  2. Effective Security Rules: Use Azure Portal or CLI (az network nic show-effective-security-rules) to inspect the combined Subnet + NIC rule evaluation on the target VM.
  3. IP Flow Verify: Run Network Watcher IP Flow Verify with the specific 5-tuple payload to see which precise NSG and rule name is dropping packets.
  4. Local OS Firewall: Check if the internal OS firewall (Windows Firewall / iptables / ufw) on the VM itself is blocking inbound requests on port 443.
Q8: How do you enforce asymmetric routing prevention when implementing Azure Firewall in a Hub-and-Spoke topology?
  • Cause: Asymmetric routing occurs when request traffic reaches a spoke via an external route (e.g., direct public IP or Gateway), but return traffic is redirected to Azure Firewall via a 0.0.0.0/0 User Defined Route (UDR), causing the stateful firewall to drop the connection.
  • Fix: Enforce SNAT (Source Network Address Translation) on Azure Firewall for internal ranges, or adjust User Defined Routes (UDRs) and Gateway Subnet routing tables so both inbound and outbound legs traverse the same firewall instance.

4. Hands-On Configuration Example: Creating an NSG with Bicep

Below is an enterprise Bicep template demonstrating an NSG configuration with rule priorities, Service Tags, and Subnet association:

param location string = resourceGroup().location
// Define Application Security Group
resource webAsg 'Microsoft.Network/applicationSecurityGroups@2023-09-01' = {
name: 'asg-web-prod'
location: location
}
// Define Network Security Group with Custom Rules
resource webNsg 'Microsoft.Network/networkSecurityGroups@2023-09-01' = {
name: 'nsg-web-prod'
location: location
properties: {
securityRules: [
{
name: 'Allow-HTTP-Inbound-ASG'
properties: {
priority: 100
direction: 'Inbound'
access: 'Allow'
protocol: 'Tcp'
sourceAddressPrefix: 'Internet'
sourcePortRange: '*'
destinationApplicationSecurityGroups: [
{
id: webAsg.id
}
]
destinationPortRange: '443'
}
}
{
name: 'Deny-All-Inbound-Custom'
properties: {
priority: 4000
direction: 'Inbound'
access: 'Deny'
protocol: '*'
sourceAddressPrefix: '*'
sourcePortRange: '*'
destinationAddressPrefix: '*'
destinationPortRange: '*'
}
}
]
}
}

Troubleshoot routing issues in Azure

To troubleshoot routing issues in Azure, Network Watcher Next Hop calculates which route wins for a specific destination IP, while Effective Routes lists all active routes applied to a Virtual Machine’s Network Interface (NIC).

Prerequisites

  • Network Watcher must be enabled in the Azure region where your Virtual Machine (VM) resides.
  • You need Network Contributor or Reader permissions on the target VM and NIC.

1.Run Next Hop Diagnostics:Identify the Win Route.

First, check where a packet from your source VM will actually travel when attempting to reach the destination IP.

Option A: Via Azure Portal

  1. Search for Network Watcher in the top search bar.
  2. Under Network diagnostic tools, select Next hop.
  3. Choose your Subscription, Resource Group, Virtual Machine, and target Network Interface.
  4. Enter the Source IP address (the private IP of your VM NIC) and the Destination IP address you are trying to reach.
  5. Click Next hop.

Option B: Via Azure CLI

Bash

az network watcher show-next-hop \
--resource-group myResourceGroup \
--vm myVm \
--nic myVmVMNic \
--source-ip 10.0.0.4 \
--dest-ip 10.1.0.5 \
--out table
  • VirtualAppliance: Traffic is correctly hitting an Azure Firewall or NVA.
  • VirtualNetwork: Traffic stays within local/peered VNet subnets.
  • Internet: Traffic bypasses local appliances and goes directly to the web.
  • None: Traffic is being intentionally dropped (blackholed) due to a missing route or misconfigured 0.0.0.0/0 UDR.

2.View Effective Routes for the NIC:Inspect Full Routing Table.

If Next Hop returns unexpected results (like None or Internet when you expected a firewall), inspect the underlying complete route table evaluation.

Option A: Via Azure Portal

  1. Navigate to your Virtual Machine and select Networking under Settings.
  2. Click on the attached Network Interface (NIC) name.
  3. Under Help or Settings, select Effective routes.

Option B: Via Azure CLI

az network nic show-effective-route-table \
--resource-group myResourceGroup \
--name myVmVMNic \
--output table

Verification: Review the generated table. Look for:

  • Address Prefixes: Ensure your destination IP falls within an active prefix.
  • State: Verify routes show as Active. Invalid IP addresses or detached gateways will mark routes as Invalid.
  • Source: Identifies whether a rule originates from a Default system route, a User Defined Route (UDR), or a VirtualNetworkGateway (BGP).

3.Isolate and Fix the Misconfiguration:Resolution.

Compare the destination IP against the evaluated routes to correct the issue:

  • If Next Hop is None: A UDR with a destination prefix matching your traffic has Next Hop Type = None, or an RFC 1918 default blackhole route is active without a Gateway/UDR overriding it. Edit the associated Route Table to specify a valid Next Hop.
  • If Next Hop is Internet instead of NVA: The Route Table containing your 0.0.0.0/0 UDR is either not associated with the source VM’s subnet, or a more specific system/BGP route is taking precedence due to Longest Prefix Match.
  • If Next Hop is correct (VirtualAppliance) but traffic still fails: The routing layer is functioning properly. Switch to IP Flow Verify in Network Watcher to check if a Network Security Group (NSG) or Firewall policy is blocking the port/protocol.

User Defined Routes (UDRs)

User Defined Routes (UDRs) are custom network routing rules created in Azure to override or supplement Azure’s default network routing. They give you fine-grained control over how network traffic flows between subnets, Virtual Networks (VNets), on-premises environments, and the internet.

1. Why Are UDRs Needed?

By default, Azure automatically creates a System Route Table for every subnet in a VNet. System routes allow resources in a subnet to talk directly to:

  • Other resources in the same VNet.
  • Other VNets joined via VNet Peering.
  • The Internet (direct outbound access).
  • On-premises networks (if connected via VPN or ExpressRoute).

While convenient, default routing can create security and governance risks because resources can communicate directly without inspection.

UDRs allow you to break this default direct path. For example, instead of letting a database subnet send internet-bound traffic directly out to the web, a UDR forces that traffic to pass through an Azure Firewall or a Network Virtual Appliance (NVA) first for security inspection.

2. Core Components of a Route Table

A User Defined Route is contained inside a Route Table resource in Azure. A Route Table consists of:

  • Name: A descriptive label (e.g., udr-spoke-to-hub).
  • Address Prefix (Destination): The IP address range in CIDR notation (e.g., 0.0.0.0/0 for all internet traffic) that triggers the rule.
  • Next Hop Type: Where traffic matching the destination range should be forwarded.
  • Next Hop IP Address: The specific IP address of the firewall or virtual appliance (required when the Next Hop Type is set to Virtual Appliance).
Common Next Hop Types
Next Hop TypeUsage Scenario
Virtual ApplianceRoutes traffic to a specific internal IP address (e.g., an Azure Firewall private IP, Palo Alto, Fortinet, or custom proxy).
Virtual Network GatewayRoutes traffic to a VPN or ExpressRoute Gateway (used for forcing on-premises routing).
Virtual NetworkRoutes traffic within the VNet boundary (overriding default behavior).
InternetExplicitly routes traffic directly out to the public internet.
NoneDrops matching traffic completely (acts as a black hole / traffic sink).

3. How Azure Chooses Which Route to Use

When a packet leaves a subnet, Azure evaluates the available routes in a strict order:

┌──────────────────────────────────────────────────────────┐
│ Incoming Network Packet │
└────────────────────────────┬─────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ 1. Longest Prefix Match (Most Specific Subnet/IP First) │
│ e.g., 10.0.1.0/24 takes priority over 10.0.0.0/16 │
└────────────────────────────┬─────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ 2. Route Origin Preference (If Prefixes Match Exactly) │
│ User Defined Route (UDR) ► OVERRIDES ► System Route │
└──────────────────────────────────────────────────────────┘
  1. Longest Prefix Match: Azure prefers the route with the most specific IP mask. A route destined for 10.1.1.0/24 will always beat a broader route destined for 10.0.0.0/8 or 0.0.0.0/0.
  2. UDR Precedence: If a UDR and a default System Route have the exact same destination prefix, the UDR wins and overrides the system route.

4. Common Real-World Use Cases

Scenario 1: Central Egress Inspection (Hub-and-Spoke Topology)

In an Enterprise Landing Zone, you want all outbound internet traffic from application spoke VNets to be inspected by a central Azure Firewall in the Hub VNet.

  • Route Table Name:udr-corp-spoke
  • Address Prefix:0.0.0.0/0
  • Next Hop Type:Virtual Appliance
  • Next Hop Address:10.0.0.4 (Azure Firewall Private IP)
  • Subnet Association: Associated with AppSubnet and DBSubnet.
Scenario 2: Preventing Direct Internet Exposure (Forced Tunneling)

You want to ensure that all internet traffic from Azure goes back to your on-premises data center via ExpressRoute/VPN before reaching the internet.

  • Address Prefix:0.0.0.0/0
  • Next Hop Type:Virtual Network Gateway

5. Key Best Practices & Gotchas

  • Subnet-Level Association: Route Tables are applied at the Subnet level, not at the VNet level or individual Virtual Machine level.
  • BGP Propagation Control: When connecting via ExpressRoute or VPN, BGP routes are automatically pushed to your subnets. You can disable Virtual network gateway route propagation on a Route Table to prevent on-premises routes from dynamically overriding local subnet policies.
  • Avoid Gateway Subnet Lockout: Never attach a 0.0.0.0/0 UDR with Next Hop = Virtual Appliance directly to the GatewaySubnet or AzureFirewallSubnet itself, as this will cause routing loops and break connectivity.

Azure network security configurations

Azure network security configurations rely on a defense-in-depth model operating across multiple layers (L3/L4 transport filtering, L7 application inspection, and platform-level perimeter defense).

Below is an overview of the primary Azure network security constructs, how they differ, and standard deployment patterns.

1. Network Access Control Controls

Network Security Groups (NSGs)
  • Scope:L3/L4 stateful packet inspection. Attached to Subnets or Network Interfaces (NICs).
  • Rule Syntax:Evaluates 5-tuple hash (Source IP, Source Port, Destination IP, Destination Port, Protocol) based on rule Priority (100–4096). Lower numbers take precedence.
  • Service Tags: Simplifies rule management by representing groups of IP address prefixes (e.g., VirtualNetwork, AzureCloud, Storage).
  • Application Security Groups (ASGs): Allows grouping virtual machines into logical application tiers (e.g., Web-Tier, DB-Tier) to write rules based on workload identity rather than explicit static IPs.
Azure Firewall
  • Scope:Fully managed, cloud-native L4/L7 stateful firewall deployed in a dedicated AzureFirewallSubnet.
  • Rule Engine:
    • DNAT Rules: Inbound port forwarding/translation.
    • Network Rules: L3/L4 filtering based on IP addresses, ports, and protocols.
    • Application Rules: Fully Qualified Domain Name (FQDN) filtering (e.g., allow *.github.com via HTTP/HTTPS).
  • SKU Tiers:
    • Basic:SMB workloads (< 250 Mbps).
    • Standard:L3–L7 filtering, threat intelligence-based filtering, DNS Proxy.
    • Premium:Signature-based Intrusion Detection & Prevention System (IDPS), TLS Inspection, and URL filtering.

2. Web & Perimeter Protection

ServiceOSI LayerScope / PlacementPrimary Use Case
Azure Web Application Firewall (WAF)Layer 7Integrated with Application Gateway or Azure Front DoorProtects HTTP/HTTPS apps from common web exploits (OWASP Top 10, SQLi, XSS) and rate limiting.
Azure DDoS ProtectionLayer 3/4Applied to Virtual Networks / Public IPsMitigates volumetric and protocol DDoS attacks with automated traffic profiling and adaptive tuning.
Azure BastionLayer 7Dedicated AzureBastionSubnetProvides agentless, secure RDP/SSH access to VMs directly via browser over TLS, keeping VMs free of public IP addresses.

3. Secure PaaS & Private Connectivity

To prevent Azure PaaS services (e.g., Storage Accounts, SQL Databases) from exposing public IP addresses:

  • Private Endpoints (Azure Private Link): Assigns a private IP address from your Virtual Network to an individual Azure PaaS instance. Eliminates public internet access and prevents data exfiltration risks.
  • Service Endpoints: Secures direct connection to PaaS endpoints by extending your VNet private address space over the Azure backbone, while keeping the public IP destination of the PaaS service.

4. Routing & Traffic Inspection Enforcers

By default, system routes in Azure allow VNet-to-VNet and outbound Internet communications directly. To force traffic through a centralized inspection point (like Azure Firewall or a Network Virtual Appliance):

  1. User Defined Routes (UDRs): Custom route tables attached to subnets.
  2. Next Hop Overrides: Route 0.0.0.0/0 (Internet) or internal VNet CIDRs to the private IP address of the Azure Firewall as the VirtualAppliance next hop.

Recommended Architecture Pattern: Hub-and-Spoke Topology

                  ┌─────────────────────────────────────────┐
                  │              Public Internet            │
                  └────────────────────┬────────────────────┘
                                       │
                               ┌───────▼───────┐
                               │  Azure WAF /  │ (Public Edge Inbound)
                               │  Front Door   │
                               └───────┬───────┘
                                       │
    ┌──────────────────────────────────▼──────────────────────────────────┐
    │ HUB VNet                                                            │
    │                                                                     │
    │  ┌───────────────────────────────────────────────────────────────┐  │
    │  │ AzureFirewallSubnet                                           │  │
    │  │ ┌───────────────────────────────────────────────────────────┐ │  │
    │  │ │                      Azure Firewall                       │ │  │
    │  │ └───────────────────────────────────────────────────────────┘ │  │
    │  └───────────────────────────────▲───────────────────────────────┘  │
    └──────────────────────────────────┼──────────────────────────────────┘
                                       │ (VNet Peering + UDR)
            ┌──────────────────────────┴──────────────────────────┐
            │                                                     │
    ┌───────▼─────────────────────────────┐       ┌───────────────▼─────────────────────┐
    │ SPOKE 1: Web App VNet               │       │ SPOKE 2: Backend VNet               │
    │                                     │       │                                     │
    │ ┌─────────────────────────────────┐ │       │ ┌─────────────────────────────────┐ │
    │ │ Subnet: Web Tier                │ │       │ │ Subnet: Database Tier           │ │
    │ │  • NSG: Allow inbound 443 from  │ │       │ │  • NSG: Allow 1433 from Web     │ │
    │ │    Firewall Subnet              │ │       │ │    subnet only                  │ │
    │ │  • UDR: Default route to FW     │ │       │ │  • Private Endpoint (SQL DB)    │ │
    │ └─────────────────────────────────┘ │       │ └─────────────────────────────────┘ │
    └─────────────────────────────────────┘       └─────────────────────────────────────┘
  1. Centralized Inspection: All spoke traffic routes through the central Hub VNet where the Azure Firewall resides.
  2. Micro-Segmentation: Spoke subnets use localized NSGs to limit lateral movement between subnets (e.g., blocking direct access to the database layer from non-web tiers).
  3. Private Access: Backend resources communicate externally or with PaaS using Private Endpoints.