Search code examples
.netauthenticationazure-web-app-servicesession-cookiesazure-deployment-slots

Azure App Service slot swap logs out all users .Net 4.8


I am using asp.net 4.8 mvc and have only been able to find support for this scenario for .net core.

Is it possible to swap an Azure stage and production slot and persist the authentication cookies for logged in users in this framework?

I have looked into Owin Interop but have not been able to find any documentation or examples.


Solution

  • Thanks @rickvdbosch for the comment.

    Azure App Service slot swap logs out all users .Net 4.8

    This issue occurs when the Application uses in-memory session state.

    Thanks @David Ebbo for the suggestion.

    As a workaround we can use Azure Redis Cache to maintain the session state which stores the data in a centralized session state provider.

    To use Azure Redis cache in .NET 4.8 Framework, Install the below NuGet package.

    Microsoft.AspNet.SessionState.SessionStateModule
    

    looked into Owin Interop but have not been able to find any documentation

    I have found a document only for a Console App.

    Refer MSDoc 1 and 2 for more details.