Home > Net >  Deployment slots in Azure FunctionApp
Deployment slots in Azure FunctionApp

Time:04-08

I'm trying to understand how deployment slot works (enter image description here

I have a few app settings in Configuration. What does this checkbox indicate? Please help me understand.

enter image description here

CodePudding user response:

Is it supposed to run only 1 slot at a time?

No, they are both supposed be running. When you create a staging slot, you now have 2 instances of your app running. One is your staging slot (where you can first test your application before swapping it with production), and the other is the production slot. see : https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots#add-a-slot

I have a few app settings in Configuration. What does this checkbox indicate? The checkbox indicates whether or not the app config value is a slot setting. if the app config value is a slot setting, then it is not updated when a swap happens between say staging and production. But if it is not a slot setting, and you swap production with staging, then the app config value in your staging environment with override the value in the production app config. In other words, selecting this check box tells App Service that the setting is not swappable. see : https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots#which-settings-are-swapped

CodePudding user response:

Azure Functions deployment slots

Azure Functions deployment slots allow your function app to run different instances called "slots". Slots are different environments exposed via a publicly available endpoint. One app instance is always mapped to the production slot, and you can swap instances assigned to a slot on demand. Function apps running under the Apps Service plan may have multiple slots, while under the Consumption plan only one slot is allowed.

The following reflect how functions are affected by swapping slots:

  • Traffic redirection is seamless; no requests are dropped because of a swap.
  • If a function is running during a swap, execution continues and the next triggers are routed to the swapped app instance.

Whether or not the app config value is a slot setting is indicated by the checkbox. If the app config value is a slot setting, it is not changed when the staging and production environments are switched.

Why use slots?

There are a number of advantages to using deployment slots. The following scenarios describe common uses for slots:

  • Different environments for different purposes: Using different slots gives you the opportunity to differentiate app instances before swapping to production or a staging slot.
  • Prewarming: Deploying to a slot instead of directly to production allows the app to warm up before going live. Additionally, using slots reduces latency for HTTP-triggered workloads. Instances are warmed up before deployment, which reduces the cold start for newly deployed functions.
  • Easy fallbacks: After a swap with production, the slot with a previously staged app now has the previous production app. If the changes swapped into the production slot aren't as you expect, you can immediately reverse the swap to get your "last known good instance" back.

For further Reference.

  • Related