📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

πŸ“š Interview question

Design a production-ready hosting setup on Azure for a customer-facing .NET 10 API that holds personal information. Cover App Service or Container Apps, deployment slots or revisions, private endpoints and VNet integration, how traffic gets in, identity, monitoring, and how you use Australia East and Australia Southeast for resilience and data residency.

Architecture of a production .NET 10 API on Azure App Service or Container Apps: zone redundancy, slots or revisions, VNet integration and private endpoints, Front Door or Application Gateway with WAF, managed identity, monitoring, and Australia East / Southeast disaster recovery and data residency.

Senior Architecture Advanced app-service azure container-apps devops disaster-recovery private-endpoints

🎯 Key points

  • Premium v3 App Service (App Service Environment v3 only for full isolation needs) or Container Apps workload profiles, zone redundant in Australia East
  • Deployment slots (swap with warm-up) or Container Apps revisions with traffic splitting
  • Inbound through Front Door Premium or Application Gateway WAF; lock the origin to it
  • Outbound VNet integration; private endpoints and private DNS zones for SQL, Key Vault, Storage; public access disabled
  • Managed identity for every dependency; no secrets
  • Compliance controls: TLS 1.2+, encryption at rest (customer-managed keys if required), SQL auditing, dynamic data masking, logs kept in Australia
  • SLO-based alerts on availability, p95 latency and dependency failures in Application Insights
  • DR in Australia Southeast with agreed RTO/RPO and rehearsed drills; it has no availability zones

⏱ 30-second answer

I build it in layers:

  • Compute: App Service Premium v3 (or a Container Apps workload-profile environment) in Australia East with zone redundancy, at least two instances, and a health check path.
  • Releases: a staging slot with warm-up and swap (or revisions with traffic splitting).
  • Network: traffic enters through Front Door Premium or Application Gateway with WAF, the app only accepts traffic from it; outbound uses VNet integration, and SQL, Key Vault and Storage are reached through private endpoints with public access off.
  • Identity and ops: managed identity everywhere, Application Insights and alerts on SLOs.
  • Resilience: a warm or cold standby in Australia Southeast with SQL failover groups and geo-redundant storage, all from IaC.

The trade-off is cost and complexity (private DNS, more resources) versus a much smaller attack surface and a tested recovery path.

πŸ—£ Full answer (senior)

How I would answer this in an interview

"I'd start from the requirements: it's customer-facing, it holds personal information, so the Privacy Act and the Notifiable Data Breaches scheme apply, and I need an availability target, say 99.9%, and a recovery objective agreed with the business. For compute I'd use App Service Premium v3 with zone redundancy in Australia East and at least two instances, or a Container Apps environment with workload profiles and zone redundancy if the team ships containers. Releases go through a staging slot: deploy, warm up with the health check and applicationInitialization, smoke test, then swap, and swap back if it goes wrong. With Container Apps I'd use revisions and shift traffic 10% then 100%.

For example, at [company] we had [an API on a Standard plan with public SQL and storage endpoints]. I [designed / led] moving it behind Front Door Premium with WAF, locked App Service access restrictions to Front Door's service tag and our Front Door id header, turned on VNet integration, and put SQL, Key Vault and Storage behind private endpoints with public network access disabled. Everything used a user-assigned managed identity. [The penetration test findings dropped from N to M], and a DR drill restored service in Australia Southeast in [X minutes].

For resilience, Australia East has availability zones, so zone redundancy covers a data-centre failure. Australia Southeast is the paired region but has no zones, so it's my disaster recovery site: an auto-failover group for Azure SQL, geo-redundant storage, Key Vault replicated, and Bicep that can stand up compute there in minutes. Front Door can fail over between origins. The mistake I see is teams adding private endpoints but forgetting the private DNS zones, so the app still resolves the public address and fails. The goal is simple: no public data endpoints, no secrets, and a failover we've actually rehearsed."


Reference architecture

Layer Choice Why
Edge Front Door Premium + WAF (or App Gateway WAF v2 for in-region only) TLS, WAF rules, DDoS absorption, origin failover
Compute App Service P1v3+, zone redundant, β‰₯ 2 instances; or Container Apps workload profiles, zone redundant No single instance or zone failure
Release Staging slot + swap / revisions + traffic split Zero-downtime deploys and instant rollback
Outbound Regional VNet integration, route all traffic Reach private endpoints, control egress
Data Azure SQL (zone redundant), Storage ZRS/GZRS, Key Vault: all with private endpoints No public data endpoints
Identity User-assigned managed identity No secrets; roles in IaC
Ops Application Insights, diagnostic settings to Log Analytics, Defender for Cloud Detect and investigate
DR Australia Southeast: SQL failover group, GZRS, IaC for compute Region failure

Front Door or Application Gateway

Front Door Premium Application Gateway WAF v2
Scope Global edge Regional, inside your VNet
Multi-region failover Built in Needs Traffic Manager or Front Door
Private origin Private Link to App Service or Container Apps VNet routing
Data residency note TLS terminates at the nearest edge location (Australian points of presence for Australian users) Traffic stays in region

Production example

For a [health-sector] API at about 300 requests per second, this setup cost roughly [A$4,000] a month more than a single public Standard plan, mostly for Front Door Premium, zone-redundant SQL and a second region. It removed every public data endpoint, and the last DR drill failed over SQL and compute to Australia Southeast in [about 12 minutes] with under a minute of data loss.

πŸ” What the interviewer is checking

Checks that the candidate can design a secure, resilient Azure hosting setup and justify each layer against requirements.

Green flags

  • Starts from data sensitivity, SLA and RTO/RPO
  • Separates inbound (Front Door, access restrictions) from outbound (VNet integration, private endpoints)
  • Knows private DNS is required and that Australia Southeast has no availability zones
  • Uses slots or revisions for safe releases and rehearses failover

Red flags

  • Public endpoints on SQL and Storage with firewall rules as the only control
  • Single instance, no health checks
  • Adds every service without cost or need justification

πŸ“š Learn in depth

1. Request path

User (Sydney) ─▢ Front Door POP (WAF, TLS) ──Private Link──▢ App Service (Australia East, zones 1-3)
                                                               β”‚ VNet integration (outbound)
                                                               β–Ό
                                                   snet-integration ─▢ private endpoints:
                                                     sql-orders (privatelink.database.windows.net)
                                                     kv-orders  (privatelink.vaultcore.azure.net)
                                                     st-orders  (privatelink.blob.core.windows.net)

Inbound and outbound are separate features on App Service. Access restrictions or a private endpoint on the app control inbound. VNet integration controls outbound: the app's calls leave through a delegated subnet, so they can reach private endpoints and go through a firewall or NAT gateway.

2. Private endpoints and DNS

A private endpoint is a NIC in your subnet with a private IP for one resource. The public name sql-orders.database.windows.net gets a CNAME to sql-orders.privatelink.database.windows.net. If a private DNS zone for privatelink.database.windows.net is linked to the VNet, that name resolves to the private IP; otherwise it resolves publicly, and with public access disabled the connection fails. Most private endpoint outages are DNS.

3. Zone redundancy

Australia East has three availability zones. A zone-redundant App Service plan spreads instances across zones; zone-redundant Azure SQL keeps replicas in different zones; ZRS storage writes three copies across zones. A zone failure then costs capacity, not availability. Plan for the surviving zones to handle full load.

4. Slots and revisions

A slot is a separate app on the same plan with its own hostname. Swap warms the staging slot (it calls the app's root or applicationInitialization paths), then switches routing. Settings marked deployment slot setting stay with the slot (for example, a staging database). Rollback is swapping back. Container Apps revisions are immutable snapshots; in multiple-revision mode you split traffic by percentage and roll back by moving traffic.

5. Disaster recovery in Australia

Component Australia East Australia Southeast Failover
Azure SQL Primary, zone redundant Geo-secondary Auto-failover group listener
Storage GZRS Geo copy Customer-initiated failover
Compute Active Cold (IaC) or warm (scaled down) Front Door origin priority
Key Vault Primary Paired-region replica (read-only during outage) Automatic

Australia Southeast has no availability zones, so it is a DR site, not a second zone-redundant primary. RPO for SQL geo-replication is typically seconds; RTO depends on whether compute is warm or rebuilt.

6. Compliance context

The Privacy Act 1988 and APP 8 make cross-border disclosure of personal information the organisation's responsibility, so keeping data and backups in Australian regions simplifies compliance. The NDB scheme requires notifying eligible breaches, which is why diagnostic logs and Defender alerts matter. Government work often needs IRAP-assessed services, which Azure's Australian regions provide for many services.

Try it yourself

  1. Deploy App Service with VNet integration and a private endpoint for a SQL database; run nslookup from the Kudu console to see the private IP.
  2. Remove the private DNS zone link and watch the connection fail.
  3. Create a staging slot, mark one setting as a slot setting, deploy and swap; note which settings move.
  4. Set up a SQL auto-failover group to Australia Southeast and run a planned failover; time the listener switch.

πŸ’» Code

Key parts of the setup in Bicep: a zone-redundant plan, VNet integration, a staging slot, and a private endpoint with its DNS zone group.

param location string = 'australiaeast'
param subnetIntegrationId string
param subnetPrivateEndpointsId string
param privateDnsZoneSqlId string
param sqlServerId string
param identityId string

resource plan 'Microsoft.Web/serverfarms@2023-12-01' = {
  name: 'asp-orders-prod-aue'
  location: location
  sku: { name: 'P1v3', capacity: 3 }
  properties: { zoneRedundant: true, reserved: true } // Linux, spread across zones
}

resource app 'Microsoft.Web/sites@2023-12-01' = {
  name: 'app-orders-prod-aue'
  location: location
  identity: { type: 'UserAssigned', userAssignedIdentities: { '${identityId}': {} } }
  properties: {
    serverFarmId: plan.id
    httpsOnly: true
    virtualNetworkSubnetId: subnetIntegrationId   // outbound through the VNet
    vnetRouteAllEnabled: true
    siteConfig: {
      linuxFxVersion: 'DOTNETCORE|10.0'
      healthCheckPath: '/healthz/ready'
      minTlsVersion: '1.2'
      ftpsState: 'Disabled'
      ipSecurityRestrictions: [
        {
          name: 'front-door-only'
          action: 'Allow'
          tag: 'ServiceTag'
          ipAddress: 'AzureFrontDoor.Backend'
          priority: 100
          headers: { 'x-azure-fdid': [ '<front-door-id>' ] } // only OUR Front Door
        }
      ]
    }
  }
}

resource staging 'Microsoft.Web/sites/slots@2023-12-01' = {
  parent: app
  name: 'staging'
  location: location
  properties: { serverFarmId: plan.id }
}

resource sqlPe 'Microsoft.Network/privateEndpoints@2023-11-01' = {
  name: 'pe-sql-orders-prod-aue'
  location: location
  properties: {
    subnet: { id: subnetPrivateEndpointsId }
    privateLinkServiceConnections: [
      { name: 'sql', properties: { privateLinkServiceId: sqlServerId, groupIds: [ 'sqlServer' ] } }
    ]
  }
}

// Without this, the app resolves the public address and fails once public access is off.
resource sqlPeDns 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2023-11-01' = {
  parent: sqlPe
  name: 'default'
  properties: {
    privateDnsZoneConfigs: [ { name: 'sql', properties: { privateDnsZoneId: privateDnsZoneSqlId } } ]
  }
}

Readiness checks the dependencies the app needs to serve traffic, so slot swaps and Front Door only send traffic to healthy instances:

using Microsoft.Extensions.Diagnostics.HealthChecks;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHealthChecks()
    .AddCheck("self", () => HealthCheckResult.Healthy(), tags: ["live"])
    .AddSqlServer(builder.Configuration.GetConnectionString("Orders")!, tags: ["ready"]);

var app = builder.Build();
app.MapHealthChecks("/healthz/live", new() { Predicate = r => r.Tags.Contains("live") });
app.MapHealthChecks("/healthz/ready", new() { Predicate = r => r.Tags.Contains("ready") });
app.Run();

⚠ Common mistakes

  • Mistake: Adding private endpoints without private DNS zones linked to the VNet. Why it is wrong: The app still resolves the public IP and fails when public access is disabled. Instead: Create privatelink.* zones, link them and add DNS zone groups to each endpoint.
  • Mistake: Leaving the App Service default hostname open after adding Front Door. Why it is wrong: Attackers bypass the WAF by calling *.azurewebsites.net directly. Instead: Restrict to the AzureFrontDoor.Backend service tag plus your X-Azure-FDID, or use Private Link.
  • Mistake: Running one instance and calling it production. Why it is wrong: Platform maintenance and zone failures cause outages. Instead: At least two zone-redundant instances with a health check path.
  • Mistake: Swapping slots without warm-up or slot-sticky settings. Why it is wrong: Cold instances get production traffic, and staging settings (like a test database) move to production. Instead: Configure applicationInitialization, health checks and mark environment-specific settings as slot settings.
  • Mistake: Treating Australia Southeast as a zone-redundant second primary. Why it is wrong: It has no availability zones. Instead: Use it as the DR region with failover groups and GZRS.
  • Mistake: Never testing failover. Why it is wrong: DR plans fail on DNS, firewall rules and missing secrets in the other region. Instead: Run planned failover drills at least twice a year and record RTO and RPO.
  • Mistake: Sending logs and backups to a non-Australian region by default. Why it is wrong: Personal information leaves Australia, which complicates APP 8 obligations. Instead: Pin Log Analytics, backups and geo-replication to Australian regions.

πŸ› Senior insight: trade-offs

Every layer here costs money and adds failure modes, so I size it to the data and the SLA. A public internal tool doesn't need Front Door Premium and two regions; an API holding health or financial data does. The order I add things in: identity and no secrets first (cheapest, biggest risk reduction), then private data endpoints, then WAF at the edge, then zone redundancy, then a second region once the business signs off the RTO. Premium v3 is enough for most workloads; I reach for App Service Environment v3 only when a single-tenant, fully isolated deployment is required (some government or banking contracts) or the app needs scale beyond a multi-tenant plan, because it costs considerably more.

Option When it fits Cost When not to
Zone redundancy only 99.9–99.95% target, region outage acceptable Moderate Contractual RTO for region loss
Warm standby in Australia Southeast Region outage must be minutes Second region running scaled down Low-value internal apps
Cold standby (IaC rebuild) RTO of hours is acceptable Storage and SQL geo-replica only Tight RTO
App Service Environment v3 Single-tenant isolation required High fixed cost Normal multi-tenant needs
Front Door Premium Public, global edge, multi-region Per hour + per request Strict in-region-only traffic (use App Gateway)
Application Gateway WAF Regional, VNet-centric Per hour + capacity units Multi-region failover alone

Compliance controls for personal information

  • In transit: TLS 1.2 minimum at Front Door and App Service, HTTPS only, private endpoints for data.
  • At rest: SQL Transparent Data Encryption and Storage encryption are on by default; use customer-managed keys in Key Vault if the contract requires key control. Always Encrypted for the most sensitive columns, such as Medicare or tax file numbers.
  • Access and audit: Entra-only SQL authentication, SQL auditing and Storage diagnostic logs to a Log Analytics workspace in Australia East, Defender for Cloud and Defender for SQL alerts, dynamic data masking for support staff.
  • Breach readiness: logs retained long enough to assess an eligible data breach under the NDB scheme within its 30-day assessment window.

RTO, RPO and drills

For a customer-facing API with personal information, a typical agreement is an RTO of 1–4 hours and an RPO of minutes for a region loss, and near-zero for a zone loss. SQL geo-replication gives an RPO of seconds; a warm standby gives an RTO of minutes, a cold IaC rebuild hours. I rehearse it: a planned SQL failover-group failover and Front Door origin switch twice a year, a restore-from-backup test each quarter, and a tabletop exercise with support and comms. Each drill records the measured RTO and RPO and the fixes it found.

What I monitor

Application Insights availability tests from Australian locations; alerts on availability below the SLO, p95 latency above target (for example 500 ms), dependency failure rate for SQL and Key Vault, and HTTP 5xx rate; Front Door WAF blocked-request rate; SQL DTU or vCore and storage percentage; and Defender for Cloud secure score. Alerts go to an action group tied to the on-call rota.

πŸ”— Follow-ups the interviewer may ask

  1. When: Candidate chooses between App Service and Container Apps Why: Checks they can justify the compute choice on cost, control and operations
    How to answer

    I choose by how much platform the team wants to run:

    • App Service: one or a few web apps, always on, deployment slots, almost no ops. Paid per plan instance.
    • Azure Functions: event-driven or spiky work (queues, timers, blobs); Flex Consumption scales per event and to zero.
    • Container Apps: containerised microservices on managed Kubernetes with KEDA scaling, revisions and scale to zero, without touching the cluster.
    • AKS: full Kubernetes when you need its API, custom networking or many services and have a platform team.

    The trade-off is control versus operations: each step towards AKS gives more control and more work. I start with the simplest option that meets the requirements and move only when I hit a concrete limit.

  2. When: Candidate mentions revisions or rolling deploys Why: Checks they drain in-flight requests during deploys
    How to answer

    On SIGTERM, Kubernetes removes the pod from endpoints and signals the container at roughly the same time, but endpoint removal takes a few seconds to reach every node and ingress. So I fail readiness as soon as ApplicationStopping fires and add a preStop sleep of about 5–10 s so routing catches up. I let the host finish in-flight requests within HostOptions.ShutdownTimeout (30 s by default since .NET 8), and keep terminationGracePeriodSeconds longer than the preStop delay plus the shutdown timeout. Background services must honour the stopping token. I verify with a load test during a rolling deploy: zero 5xx.

  3. When: Candidate mentions Key Vault behind a private endpoint Why: Checks secret rotation, caching and start-up failure handling with Key Vault
    How to answer

    I'd inventory and classify every setting first: secrets, environment-specific values, shared values, and which must change live. Secrets go to Key Vault. Non-secret settings and feature flags go to Azure App Configuration with a label per environment, and secrets are referenced from there through Key Vault references. The app authenticates with its managed identity using least-privilege roles, and where possible secrets disappear entirely through passwordless Entra ID auth to SQL, Storage and Service Bus.

    For refresh, use a sentinel key with a refresh interval and a secret refresh interval, and read live values through IOptionsMonitor. Rotation uses overlapping versions, so old and new both work during the window. Add start-up timeouts and replicas, and keep ValidateOnStart.

    The trade-off: central, audited, rotatable configuration, in exchange for a network dependency at start-up that you must design for.

πŸ›  Real-world problems: how you handle them

Private endpoint cut-over broke production because of DNS
Situation
We moved a customer API on App Service in Australia East to private endpoints for Azure SQL and Key Vault ahead of [a penetration test]. The API served [about 300] requests per second and held [customer personal information].
Signals
Seconds after disabling public network access on SQL, the error rate went to [100%], logs showed `SqlException: ... Deny Public Network Access is set to Yes`, and Key Vault calls returned 403 `ForbiddenByConnection`. The health check took instances out of rotation.
Investigation
From the Kudu console ran `nslookup sql-orders-prod-aue.database.windows.net`: it returned the public IP, not the 10.x private IP. Checked the private endpoint: no DNS zone group, and the `privatelink.database.windows.net` zone existed but was linked to the hub VNet only, not the spoke the app integrated with.
Resolution
Immediate: re-enabled public network access with the previous firewall rules to restore service (about [9] minutes of errors). Real fix: added DNS zone groups to both private endpoints, linked the private DNS zones to the spoke VNet, verified private resolution from the app, then disabled public access again in a planned window.
Prevention
Added a pipeline step that resolves each dependency from the app and fails if the IP is public, an Azure Policy that auto-creates DNS zone groups for private endpoints, and a runbook for network changes with a tested rollback.

How to tell it (STAR)

**S:** We were moving our customer API's SQL and Key Vault to private endpoints before a penetration test. **T:** I [led] the cut-over. **A:** When we disabled public access, every request failed. From Kudu, `nslookup` showed SQL still resolving to its public IP: the private DNS zone wasn't linked to our spoke VNet and the endpoints had no DNS zone group. I rolled back public access to restore service, fixed the DNS links, verified private resolution and then cut over again. **R:** Errors lasted [9] minutes, the second cut-over had zero impact, and we added a pipeline check so DNS mistakes fail the deployment instead of production.

↩ Usually asked after

More in Azure

Last updated 23 Nov 2026.

🌐 Sangam's Webring

βͺ Previous 🏠 Main Next ⏩
πŸ’¬ Chat with me