How to prevent "swapping" of "Staged" Azure sites from user registration?

I deployed to Azure web applications MVC3, Membership Services, .NET4, C #, Razor, EF4.1, SQL Azure using Azure websites (standard).

I experimented with a new "intermediate" function, where you can "change" in the updated web application. Fine. We would really like to update the code without interfering with the end user, i.e. Continuous integration of small fixes. However, we noticed that “Swap” registers users, which is not ideal. I suspect this is because authentication cookies are lost after "swap", so the session cannot authenticate, causing users to return to the login page. Is there any way around this? The only thought I had was to somehow save the "main" database.

Thoughts appreciated.

Thanks in advance.

+4
source share
1 answer

Since your stage application is in a different instance, you will need to have the appropriate machineKey file for the two applications. Add the following code to your web.config so that machineKey will not be automatically generated.

<machineKey
    validationKey="052851E2D519231BE84E455B4C4A9FBC0CAC53B8FE7BBA1917FC296ACE6F41832383347EAEC498F40978DDD3374E7A666AFD0ADC1084A9E48B1B40ADC918C9A6"
    decryptionKey="7077D8F4C273E3FC5CE296F3B74897ACECF055F9BA01565372EE87B8746DE50F"
    validation="SHA1" 
    decryption="AES" />

Replace the keys with yours. You can generate them through IIS or here . You can also change the encryption and decryption algorithms if you want to.

Additional MSDN Information

+6
source

Source: https://habr.com/ru/post/1538096/


All Articles