Create and configure Azure App Service
Pick an App Service plan, scale it, add custom domains and TLS, back up apps, connect them to networks and release safely with deployment slots.
- 22 min
- 8 concepts
- Try it yourself
- 5-question check
Learn
Azure App Service hosts web apps, APIs and mobile back ends as platform as a service. Microsoft patches the OS and runtime; you deploy code or a container.
Every app runs in an App Service plan, which defines the region, the number and size of VM instances, and the pricing tier. The tier decides which features you get.
- 1
Provision an App Service plan
Tiers fall into three groups. Shared (Free and Shared) runs on VMs shared with other customers. Dedicated (Basic, Standard, Premium v3 and v4) runs on VMs only your plan uses. Isolated v2 runs in an App Service Environment inside your own virtual network.
Several apps can share one plan and its instances. Move an app to its own plan if it competes with others for resources.
Remember: You pay for the plan's instances, not per app.
- 2
Configure scaling for an App Service plan
Scale up means a higher tier or bigger instances. Scale out means more instances, either manually or with autoscale rules on metrics or a schedule.
Free and Shared can't scale out. Autoscale starts at Standard. All apps in a plan scale together.
Remember: Scale up = bigger. Scale out = more.
- 3
Create an App Service
When you create a web app you choose code or container, the runtime stack and version, the OS (Windows or Linux), the region and the plan.
Deploy from GitHub Actions, Azure DevOps, a ZIP file, FTP or a container registry. Application settings and connection strings are exposed to the app as environment variables.
Remember: Keep secrets in Key Vault and use Key Vault references in app settings.
- 4
Configure certificates and Transport Layer Security (TLS) for an App Service
Every app gets HTTPS on its default
azurewebsites.netname. For a custom domain you can use a free App Service managed certificate, a certificate from Key Vault, or upload your own.Turn on HTTPS Only to redirect HTTP to HTTPS, and set the minimum TLS version. SNI-based TLS bindings are free; IP-based bindings may cost extra.
Remember: Custom domains and TLS bindings need Basic or higher.
- 5
Map an existing custom DNS name to an App Service
For a subdomain such as
www.contoso.com, create a CNAME pointing to the app'sazurewebsites.netname. For the root domain, create an A record pointing to the app's IP.App Service also needs a TXT record (
asuid) with the domain verification ID to prove you own the domain.Remember: Subdomain: CNAME. Root domain: A record. Both: TXT for verification.
- 6
Configure backup for an App Service
App Service can back up the app's content, configuration and, optionally, a linked database. Automatic backups are included in Basic and higher; custom backups to your own storage account can be scheduled.
You can restore to the same app, another app or a deployment slot.
Remember: Backups need a supported tier; Free and Shared don't include them.
- 7
Configure networking settings for an App Service
Inbound: access restrictions (IP and service endpoint rules) and private endpoints control who can reach the app. Outbound: VNet integration lets the app reach resources in a virtual network, such as a database behind a private endpoint.
Hybrid connections let an app reach a specific host and port on-premises through a relay.
Remember: Private endpoint is for traffic coming in. VNet integration is for traffic going out.
- 8
Configure deployment slots for an App Service
Deployment slots are live apps with their own host names, such as a
stagingslot. Deploy to staging, warm it up and test it, then swap it with production for a release without downtime. Swap back if something goes wrong.Settings marked as deployment slot settings stay with the slot instead of moving during a swap. Slots start at the Standard tier, with more slots on Premium.
Remember: Swap = zero-downtime release and instant rollback.
A release with deployment slots
- Deploy to stagingNew code goes to the staging slot, not production.
- Warm up and testStaging runs with its own URL and slot settings.
- SwapStaging and production swap, with no downtime.
- Roll back if neededSwap again to put the old version back.
Try it
What does the app need? Answer to find the lowest App Service tier that fits.
This interactive part needs JavaScript.
In the portal
- Scale up the planAzure portal: App Services > your app > Settings > Scale up (App Service plan)
- AutoscaleAzure portal: App Services > your app > Settings > Scale out (App Service plan)
- Custom domainsAzure portal: App Services > your app > Settings > Custom domains
- Deployment slotsAzure portal: App Services > your app > Deployment > Deployment slots
- VNet integration and private endpointsAzure portal: App Services > your app > Settings > Networking
Key terms
Click a card to see the definition.
Check your understanding
5 questions. Score 80% or more and these skills are marked as confident in your AZ-104 study plan.
What's the lowest tier with deployment slots?
Slots and autoscale start at Standard.
Which DNS record maps www.contoso.com to an app?
Subdomains use a CNAME; the root uses an A record. A TXT record verifies ownership.
An app must call a SQL database that's only reachable through a private endpoint in a VNet. What do you configure on the app?
VNet integration handles outbound traffic from the app into the VNet.
A setting must stay in staging and not move to production during a swap. What should you do?
Slot settings stick to their slot.
What does scaling out an App Service plan do?
Out = more instances. Up = bigger or higher tier.
Sources
- Microsoft Learn: Azure App Service plan overview
- Microsoft Learn: Set up staging environments in Azure App Service
- Microsoft Learn: Map an existing custom DNS name to Azure App Service
- Microsoft Learn: App Service networking features
- Microsoft Learn: Back up and restore your app in Azure App Service
Facts in this lesson are from Microsoft Learn. This site isn't affiliated with Microsoft.