Created
April 22, 2024 12:37
-
-
Save martyncoup/fd925700081181d355be032223612118 to your computer and use it in GitHub Desktop.
Add management of data protection keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add data protection keys | |
builder.Services.AddDataProtection() | |
.SetApplicationName("YourAppName") | |
.SetDefaultKeyLifetime(TimeSpan.FromDays(30)) | |
.PersistKeysToAzureBlobStorage(new Uri(builder.Configuration["DataProtectionKeysUri"]), new DefaultAzureCredential()) | |
.ProtectKeysWithAzureKeyVault(new Uri(builder.Configuration["DataProtectionVaultIdentifierUri"]), new DefaultAzureCredential()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment