Open Closed

Micro Data Protection conflict? #9424


User avatar
0
DominaTang created

I noticed ABP has these code:

context.Services .AddDataProtection() .SetApplicationName("MyApp") .PersistKeysToStackExchangeRedis(redis, "MyApp-Protection-Keys");

However, if our application want to use Microsoft Data Protection API to encyrpt/decrypt business data, we have this settings: services.AddDataProtection() .ProtectKeysWithAzureKeyVault(new Uri(keyId), new DefaultAzureCredential(new DefaultAzureCredentialOptions { ManagedIdentityClientId = keyVaultClientId })) .PersistKeysToAzureBlobStorage(azureStorageConnectionString, containerName, EncrptionConsts.DataProtectionKeyBlobName) .SetDefaultKeyLifetime(TimeSpan.FromDays(36500));

Would these two settings conflict with each other, can we simply comment out ABP's AddDataProtectioncode?

Thanks


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can remove the ABP's PersistKeysToStackExchangeRedis, just use your Key storage

    Thanks.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 01, 2025, 08:37