2

I have VSTS release, that deploys asp.net core 2.1 web application to a deployment slot and then swaps it with production slot:

release definition

Both slots have the same application settings, no setting is a "slot setting". After the slots are swapped, user's need to relogin. I guess the authentication cookie becomes invalid.

How do I prevent it?

I'm using OpenIdConnect and Cookie Authentication

Liero
  • 25,216
  • 29
  • 151
  • 297
  • 1
    I suggest you to check this SO thread which might help https://stackoverflow.com/questions/37849816/swapping-azure-web-app-deployment-slots-logs-out-all-users-in-asp-net-core-rc2 – Zahid Faroq Jul 28 '18 at 17:57
  • 1
    You need to use data protection api/configuration to persist the encryption keys. This not only apply to swapping apps, also includes deploying since the app gets restarted as well as any kind of app restart (i.e .iis pool recycling). By default the encryption keys are generated on app start and hold on memory, any restarts generates new key invalidating all old protected data – Tseng Jul 28 '18 at 18:16
  • Possible duplicate of [Swapping Azure Web App deployment slots logs out all users in ASP.NET Core RC2](https://stackoverflow.com/questions/37849816/swapping-azure-web-app-deployment-slots-logs-out-all-users-in-asp-net-core-rc2) – juunas Jul 29 '18 at 10:56

0 Answers0