Monday, October 12, 2020

Error retrieving certificates from Azure Key Vault

When retrieving certificates from Azure Key Vault I get the following error in my .NET Core 3.1 app service.  The file is read from the Key Vault just fine, but throws an exception when converting the secret to a x509 certificate:

Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException at Internal.Cryptography.Pal.StorePal.FromBlobOrFile

The short answer is that I followed the instructions in this article.

https://github.com/dotnet/runtime/issues/30658

The solution involves 2 parts:

  1. Adding `WEBSITE_LOAD_USER_PROFILE = 1` to my configuration.
  2. Upping my web app to a Standard Web App.  This error only occurs on the Free or Shared tiers.
Fixed!

No comments:

Post a Comment