<p>if both are running 'warmed up' and in 'Always On' mode then the swap would not cause a restart of any kind. But go to this URL and read the point #1 and if any of these things are done then it will restart.</p>
<p><a href="https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots#what-happens-during-a-swap" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots#what-happens-during-a-swap</a></p>

CC BY-SA 4.0
2020-08-31T15:29:32.957Z
2020-08-31T15:29:32.957Z
Hassan Raza
<p>My web application in Azure has two deployment slots - staging and production.</p>
<p>The purpose of the application is to draw a shape. The version currently deployed to the production slot draws a square. The version deployed to the staging slot draws a circle.</p>
<p>Both versions of the application have an application setting called Colour which controls the colour of the shape. Importantly, this is a deployment slot setting - see the example capture below:</p>
<p><a href="https://i.sstatic.net/6b8kp.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/6b8kp.png" alt="Deployment slot setting" /></a></p>
<p>The value of this setting is blue in the staging slot and green in the production slot.</p>
<p>When I view the application in the staging slot, a blue circle is drawn. When I view the application in the production slot, a green square is drawn.</p>
<p>When I perform a slot swap from staging into production and view the application in the production slot, a green circle is drawn.</p>
<p>I am struggling to get my head around this. A big advantage of swapping deployment slots is that I am able to swap my pre-warmed staging code into the production slot and prevent users from suffering from downtime or cold-start performance issues. However, by swapping the staging application into the production slot which has different values in the deployment slot setting, haven't I made changes to the application configuration which will trigger a restart? If I was to modify web.config manually or update the deployment slot setting in Azure, the application in the slot would restart. How is slot swapping getting around this?</p>

<azure>
Does a slot swap cause an application to restart when using deployment slot settings?
Alasdair Stark
# Does a slot swap cause an application to restart when using deployment slot settings?

(Asked by: username_0 on 2020-06-21)

My web application in Azure has two deployment slots - staging and production.

The purpose of the application is to draw a shape. The version currently deployed to the production slot draws a square. The version deployed to the staging slot draws a circle.

Both versions of the application have an application setting called Colour which controls the colour of the shape. Importantly, this is a deployment slot setting - see the example capture below:

[![Deployment slot setting](https://i.sstatic.net/6b8kp.png)](https://i.sstatic.net/6b8kp.png)

The value of this setting is blue in the staging slot and green in the production slot.

When I view the application in the staging slot, a blue circle is drawn. When I view the application in the production slot, a green square is drawn.

When I perform a slot swap from staging into production and view the application in the production slot, a green circle is drawn.

I am struggling to get my head around this. A big advantage of swapping deployment slots is that I am able to swap my pre-warmed staging code into the production slot and prevent users from suffering from downtime or cold-start performance issues. However, by swapping the staging application into the production slot which has different values in the deployment slot setting, haven't I made changes to the application configuration which will trigger a restart? If I was to modify web.config manually or update the deployment slot setting in Azure, the application in the slot would restart. How is slot swapping getting around this?

**Tags:** azure


---

## 1 answers

### Answer by username_1 on 2020-08-31. Score: 0 | Accepted answer

if both are running 'warmed up' and in 'Always On' mode then the swap would not cause a restart of any kind. But go to this URL and read the point #1 and if any of these things are done then it will restart.

<https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots#what-happens-during-a-swap>


---

