1.4: Create Azure App Service web apps - Explore Azure App Service deployment slots Flashcards
In what App Service tiers can you use deployment slots
- Standard
- Premium
- Isolated
Describe the benefits of deploying to a no-production deployment slot
- You can validate app changes in a staging deployment slot before swapping it with the production slot.
- Deploying an app to a slot first and swapping it into production makes sure that all instances of the slot are warmed up before being swapped into production. This eliminates downtime when you deploy your app.
- You can quickly revert to your previous last known good site as it’s swapped into the non-production slot.
Describe app scaling and deployment slot considerations
You can’t scale to a tier offering less deployment slots that you’re currentyl using.
(The number of slots you can use varies from tier to tier)
Describe how to make settings swappable
To make settings swappable, add the app setting WEBSITE_OVERRIDE_PRESERVE_DEFAULT_STICKY_SLOT_SETTINGS
in every slot of the app and set its value to 0 or false.
List the settings which are swapped
- General settings, such as framework version, 32/64-bit, web sockets
- App settings (can be configured to stick to a slot)
- Connection strings (can be configured to stick to a slot)
- Handler mappings
- Public certificates
- Public certificates
- Hybrid connections *
- Virtual network integration *
- Service endpoints *
- Azure Content Delivery Network *
‘*’ items are planned to be unswappable
List the settings which are unswapped
- Publishing endpoints
- Custom domain names
- Non-public certificates and TLS/SSL settings
- Scale settings
- WebJobs schedulers
- IP restrictions
- Always On
- Diagnostic log settings
- Cross-origin resource sharing (CORS)
Describe how to make a settings not swappable
To configure an app setting or connection string to stick to a specific slot (not swapped), go to the Configuration page for that slot. Add or edit a setting, and then select Deployment slot setting. Selecting this check box tells App Service that the setting is not swappable.
Describe how to manually swap a deployment slot
- Go to apps Deployment slots page and select Swap. A dialog box is shown
- Set the desired Source and Target slots (target is production)
- Select Swap
Describe how to manually swap a deployment slot with preview
A multi-phase swap:
- Follow the same step as a standard swap, but select Perform swap with preview instead of Swap in step 3
- When you’re ready to start the swap, select Start Swap.
- When you’re ready to complete the pending swap, select Complete Swap in Swap action and select Complete Swap.
Describe auto swap
Auto swap streamlines Azure DevOps scenarios where you want to deploy your app continuously with zero cold starts and zero downtime for customers of the app.
When auto swap is enabled from a slot into production, every time you push your code changes to that slot, App Service automatically swaps the app into production after it’s warmed up in the source slot.
Describe how to configure auto swap
- Go to your app’s resource page and select the deployment slot you want to configure to auto swap.
The setting is on the Configuration > General settings page. - Set Auto swap enabled to On.
Then select the desired target slot for Auto swap deployment slot, and select Save on the command bar. - Execute a code push to the source slot.
Auto swap happens after a short time, and the update is reflected at your target slot’s URL.
Describe how you can customise the warmup process
You can customise any warm up process by either:
1. Adding a initializationPage section to the web.config
2. Add one of the following app settings:WEBSITE_SWAP_WARMUP_PING_PATH
- endpoint to checkWEBSITE_SWAP_WARMUP_PING_STATUSES
- list of valid statuses
Describe deployment slot routing
By default, all client requests to the app’s production URL (http://<app_name>.azurewebsites.net) are routed to the production slot. You can route a portion of the traffic to another slot. This feature is useful if you need user feedback for a new update, but you're not ready to release it to production.</app_name>
How do you route production traffic automatically
To route production traffic automatically:
- Go to your app’s resource page and select Deployment slots.
- In the Traffic % column of the slot you want to route to, specify a percentage (between 0 and 100) to represent the amount of total traffic you want to route. Select Save.
Describe route pinning
Once traffic has been routed it’s pinned to the slot it’s been routed to (a bit like ARR affinity).
You can find out what slot it’s pinned to by checking the x-ms-routing-name
cookie in the headers
You can toggle this value via links - so you could offer access to a ‘beta’ site via a link, and once there, access to the current production site if the user wants to go back to it.
e.g.: <webappname>.azurewebsites.net/?x-ms-routing-name=staging