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.
I build it in layers:
The trade-off is cost and complexity (private DNS, more resources) versus a much smaller attack surface and a tested recovery path.
"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."
| 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 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 |
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.
Checks that the candidate can design a secure, resilient Azure hosting setup and justify each layer against requirements.
Green flags
Red flags
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.
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.
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.
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.
| 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.
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.
nslookup from the Kudu console to see the private IP.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();
privatelink.* zones, link them and add DNS zone groups to each endpoint.*.azurewebsites.net directly. Instead: Restrict to the AzureFrontDoor.Backend service tag plus your X-Azure-FDID, or use Private Link.applicationInitialization, health checks and mark environment-specific settings as slot settings.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 |
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.
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.
I choose by how much platform the team wants to run:
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.
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.
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.
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.
Last updated 23 Nov 2026.