tomsmithweb
tomsmithweb

Reputation: 371

Does a website update in Azure reset the app pool?

When pushing a website update to Azure does the app pool reset? What effects does this have to a user that is signed into the site? Would the user get signed out?

Upvotes: 3

Views: 57

Answers (1)

evilSnobu
evilSnobu

Reputation: 26334

When pushing a website update to Azure does the app pool reset?

Yes. You can check this in the Kudu Debug Console, under Process Explorer. Note how the PID of your application changes.

What effects does this have to a user that is signed into the site? Would the user get signed out?

Signing in with Azure AD (i'm assuming since you don't mention an IdP) is heavily dependant on your token cache strategy:

Assuming you're only using a memory cache for ADAL/MSAL and your app pool restarts —

In this case, the STS and ASP.NET cookie are still in the browser session, your code needs to check the cache and if it looks like a fresh cache, redirect user to STS (Challenge() in ASP.NET). This will be seamless and won't require typing in credentials since the STS cookie was never gone.

If the user session state is also stored in memory (the default for ASP.NET), then you'll lose the user's session state as well (if that holds a shopping cart, you have bigger problems to worry about).

The sensible thing to do is to move to a persistent token cache and a persistent user session store as well. Redis cache is a good choice. SQL is fine too, probably a bit much.

Upvotes: 1

Related Questions