WarmUp function in production slot after deployment

544 Views Asked by At

I'm trying to understand how deployment slots work.

Let’s say I have an Azure Function with one slot (production slot). This Azure Function contains multiple activity functions.

enter image description here

enter image description here

Now, I’m going to add a new staging slot and deploy these functions to staging slot:

enter image description here enter image description here

What I notice is that, after deployment to staging slot, I see all the functions in staging slot and only ‘Warmup function’ in production slot.

enter image description here

After a few minutes, I see all the functions back in production slot.

Does this mean, during each deployment to staging slot, Warmup function is added to production slot for some time and this would cause downtime in production? Please let me know.

1

There are 1 best solutions below

0
On

Does this mean, during each deployment to staging slot, Warmup function is added to production slot for some time and this would cause downtime in production? Please let me know.

AFAIK, Yes! For every instance, the swap operation waits to complete the restart in the source slot for getting available to requests.

If all instances on the source slot are warmed up successfully, the two slots complete the swap by switching routing rules. After this step, the target slot (for example, the production slot) has the app that's previously warmed up in the source slot. - This is called Routing Update in Swapping Operation.

After swapping of slots, the app may get unexpected restarts because the hostname binding configuration goes out of sync, in which by itself doesn't cause restarts.

Of course, doing a swap will have downtime using slots because it is not just deployment of code that adds downtime -- infrastructure deployment, especially app-settings does it as well.

Refer to the worked solution of minimizing the downtime using deployment setting variable in azure functions.