dotnet / dotnet/AspNetCore.Docs
Unclear description of data protection key storage in Azure App Service
- Dominant language
- C#
- Stars
- 13.1k
- Forks
- 24.6k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 97
Description
I find the description of Data Protection key management for Azure App Service to be a little confusing. This part is hard to understand:
> When you swap between deployment slots, for example swapping Staging to Production or using A/B testing, any app using Data Protection won't be able to decrypt stored data using the key ring inside the previous slot.
It's not clear to me which behavior is being described:
1. Deployment keys swap between slots. If the software previously running in the Production slot encrypted data, the new software swapped into the Production slot will not be able to decrypt it.
2. Deployment keys are sticky to the slot. Your Production app will not be able to decrypt anything that it protected while it was running in the Staging slot.
I would find this clearer if it explicitly said either, "Data protection keys are swapped between slots," or "Data protection keys are sticky and remain in the slot they were created." I _think_ the actual behavior is that keys are swapped, because otherwise I don't see how users would be "logged out of an app that uses the standard ASP.NET Core cookie authentication," since production and staging slots use different domains and therefore usually don't share cookies.
The next few sentences discuss "slot-independent key rings", but that sounds like it's describing sharing the same key ring with multiple slots. I do want separate key rings for each slot, I just would prefer them to be sticky.
---
#### Document Details
⚠ *Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.*
* ID: 945c28b7-6cc7-d4ed-3b96-a401eef42f59
* Version Independent ID: eb45fbf9-29fb-c67b-2f50-454380a502dd
* Content: [Data Protection key management and lifetime in ASP.NET Core](https://learn.microsoft.com/en-us/aspnet/core/security/data-protection/configuration/default-settings?view=aspnetcore-7.0)
* Content Source: [aspnetcore/security/data-protection/configuration/default-settings.md](https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/security/data-protection/configuration/default-settings.md)
* Product: **aspnet-core**
* Technology: **aspnetcore-security**
* GitHub Login: @Rick-Anderson
* Microsoft Alias: **riande**
Contributor guide
Assessment
This issue has not been assessed yet.