Azure App Service Plans Explained: DNS, HTTPS Bindings, Slots, and Scaling Rules
Blog Draft: Managing Azure App Service Plans (Custom Domains, TLS, Slots, Scaling) for AZ-104
What youโll learn
By the end of this guide, youโll be able to:
- Map a custom domain to an Azure Web App using the right DNS records
- Add HTTPS using either a managed certificate or your own certificate
- Use deployment slots to release updates safely with swap
- Scale your app correctly using scale up and scale out (manual, autoscale rules, and App Service automatic scaling)
Prerequisites
What you need
- An existing App Service (Web App) running in Azure
- A domain you control (example:
contoso.com) - Access to the domainโs DNS provider (could be Azure DNS, Cloudflare, GoDaddy, etc.)
- An App Service Plan tier that supports the features you want:
- Custom domains: generally available
- TLS/SSL binding: requires Basic or higher in most cases
- Deployment slots: requires Standard or higher
- Autoscale: depends on SKU and configuration approach
[Screenshot: App Service Overview blade showing URL, resource group, and App Service Plan]
1) Add a Custom Domain (DNS + Validation)
Why this matters
Your web app starts with a default hostname like:
https://<appname>.azurewebsites.net
A custom domain gives you:
- Branding and trust:
https://www.contoso.com - Cleaner URL structure for end users
Portal path
Azure portal โ App Services โ your app โ Custom domains โ Add custom domain
Step 1: Choose the hostname you want
Common choices:
www.contoso.com(subdomain)contoso.com(apex / root domain)
Step 2: Add DNS records at your DNS provider
Azure will show you exactly what it expects. In most real deployments, youโll add:
- A mapping record (A or CNAME)
- A verification TXT record (
asuid...)
Option A: Map www.contoso.com (recommended starting point)
Use a CNAME for www.
Example:
- CNAME
- Name:
www - Value:
<appname>.azurewebsites.net
- Name:
- TXT
- Name:
asuid.www - Value:
<verification-id-from-azure>
- Name:
Option B: Map the apex domain contoso.com
Apex domains typically require an A record.
Example:
- A
- Name:
@ - Value:
<app-ip-from-azure>
- Name:
- TXT
- Name:
asuid - Value:
<verification-id-from-azure>
- Name:
Step 3: Validate and add
Back in Azure:
- Select Validate
- Wait for green checks (DNS propagation may take time)
- Select Add
[Screenshot: Validation results showing green checkmarks]
Quick verification
- Browse to your new hostname (HTTP first is fine)
- Confirm it loads the correct app
2) Secure the Domain with HTTPS (TLS/SSL Binding)
What youโll see after adding the domain
Often, Azure shows a warning like:
- โOne or more domains are not securedโ
- Binding status: No binding
That means your custom domain is mapped, but HTTPS is not configured.
Portal path
App Services โ your app โ Custom domains โ select hostname โ Add binding
[Screenshot: Hostname list showing โNo bindingโ]
Option 1: App Service Managed Certificate (simple)
Best for most labs and many production scenarios where limitations are acceptable.
Steps:
- Add binding
- TLS/SSL type: SNI SSL
- Certificate: Create App Service Managed Certificate
- Add
[Screenshot: Add binding dialog with SNI and managed certificate selected]
Notes you should remember for AZ-104-style scenarios
- Managed cert is convenient, but not universal.
- If issuance stalls, check DNS correctness and potential CAA restrictions at your DNS provider.
Option 2: Bring your own certificate (PFX) or Key Vault
Use this when you need:
- A specific CA
- A wildcard cert
- Centralized cert lifecycle via Key Vault
Steps (high-level):
- Upload/import certificate in Certificates
- Return to Custom domains
- Add binding using your certificate
Validate HTTPS end-to-end
- Open
https://www.contoso.com - Confirm certificate details in the browser
- Optional hardening: configure HTTPS-only and redirect HTTP โ HTTPS in app code or configuration
3) Deployment Slots (Staging โ Test โ Swap)
Why slots matter
Slots let you deploy a new version safely without breaking production. You test changes in a staging URL like:
https://<appname>-staging.azurewebsites.net
Then you swap staging into production.
Portal path
App Services โ your app โ Deployment slots โ Add Slot
Step 1: Create a staging slot
- Slot name:
staging - Clone settings from: production (recommended)
[Screenshot: Add slot dialog with โClone settings from productionโ]
Step 2: Deploy to the staging slot
Common patterns:
- GitHub Actions pipeline targets the slot
- Zip deploy
- Azure DevOps release pipeline
Key concept: the slot has its own URL, so you can test safely.
Step 3: Swap
When staging is validated:
- Go to Deployment slots
- Select Swap
- Source:
staging - Target:
production - Start swap
Slot settings (sticky settings) you must understand
Some settings should not swap (common examples):
- Connection strings (staging DB vs prod DB)
- Feature flags
- API keys that differ per environment
Mark them as Deployment slot setting so they stay with the slot.
4) Scaling the App Service Plan
First, learn the two scaling directions
Scale up
Scale up changes the plan tier/size:
- More CPU and RAM
- More features (depending on tier)
Think: โbigger machineโ
Scale out
Scale out changes instance count:
- More instances behind the same app URL
Think: โmore machinesโ
Where scaling happens
You can scale from:
- The App Service Plan (affects all apps in that plan)
- The App itself (still changes the underlying plan behavior)
[Screenshot: App Service Plan blade showing apps sharing the plan]
Scale out modes youโll see
A) Manual
You set instance count yourself.
- Good for predictable events (product launch, scheduled promotion)
B) Autoscale rules (metric-based or schedule-based)
This is the exam-friendly model:
- Add instances when a metric is high
- Remove instances when a metric is low
- Optionally scale on a schedule
Example rule set
- If CPU > 70% for 10 minutes: +1 instance
- If CPU < 20% for 15 minutes: -1 instance
- Minimum instances: 1
- Maximum instances: 5
Implementation notes
- Always configure both scale out and scale in rules.
- Use sensible cool-down periods to avoid โthrashing.โ
C) App Service Automatic scaling (HTTP-based)
Some configurations provide an โAutomaticโ option that scales based on incoming HTTP traffic characteristics.
- Useful for simple apps when you do not want to tune metrics
- Still requires you to define ceilings and readiness levels
Common Troubleshooting (Fast Fixes)
Custom domain validation fails
Check:
- TXT record name is correct (
asuidorasuid.<subdomain>) - CNAME points to
<appname>.azurewebsites.net(not your vanity name) - A record points to the IP Azure provided
- DNS propagation has completed
Custom domain works but HTTPS shows โNo bindingโ
Check:
- You actually created and attached a certificate binding to that hostname
- The plan tier supports TLS binding
- The certificate issuance is complete (managed cert can take time)
Swap completed but production looks wrong
Check:
- App settings and connection strings that were not marked as slot settings
- Any environment-specific values overwritten by the swap
Autoscale not triggering
Check:
- Metric time range and aggregation settings
- Cooldown too long
- Thresholds unrealistic (CPU rarely hits configured values)
- Minimum/maximum instance limits blocking action
AZ-104 Exam Notes to Memorize
- Custom domain mapping requires correct DNS plus verification TXT in many scenarios.
- TLS binding is a separate step from adding the domain.
- Deployment slots are a Standard+ feature and provide a clean staging URL.
- Swap exchanges slot content and most settings unless marked as slot-specific.
- Scale up changes SKU/size. Scale out changes instance count.
Mini-Quiz (AZ-104 Style)
Questions
- You mapped
www.contoso.comto an App Service. Which DNS record is most common forwww? - After adding a custom domain, Azure shows โNo binding.โ What is missing?
- Your team needs a staging environment with a separate URL and a zero-downtime cutover. What feature should you use?
- You want to ensure staging uses a test database and production uses the real database even after swap. What must you configure?
- Which scaling option increases CPU/RAM per instance?
- Which scaling option increases the number of instances?
- You configured autoscale to add instances when CPU > 70%. What rule should you add next for stability?
- Multiple web apps share the same App Service Plan. If you scale out the plan, what happens?
Answer key
- CNAME pointing
wwwโ<appname>.azurewebsites.net - TLS/SSL binding is missing (certificate not bound to the hostname)
- Deployment slots (staging slot + swap into production)
- Mark the DB connection string or setting as a deployment slot setting (sticky setting)
- Scale up
- Scale out
- Add a scale-in rule (example: CPU < 20% then remove 1 instance) plus cooldown
- The plan scales out, so all apps in that plan benefit from added instances (shared compute pool)
