user704772
user704772

Reputation: 319

Azure web app key vault exception when recycled

We have several ASP.NET Core web apps that use the Azure Key Vault.

This works well through all manual restarts, but when the web app is recycled automatically by Azure it does not start successfully due to a "KeyVaultErrorException: Client address is not authorized and caller is not a trusted service".

Restarting manually then works correctly. We have appinitialization turned on.

I realize that multiple instances would mitigate this, but how can we have the app successfully restart when recycled by Azure?

Edit: The key vault is setup using the "Add connected services" through Visual Studio 2019, via the Microsoft.AspNetCore.AzureKeyVault.HostingStartup package v2.0.4

Upvotes: 0

Views: 174

Answers (1)

Joy Wang
Joy Wang

Reputation: 42123

Navigate to the keyvault in the portal -> Networking, make sure you select the Allow access from All networks.

Or if you select the Private endpoint and selected networks, try to add all the Additional Outbound IP Addresses to the firewall.

enter image description here

enter image description here

Upvotes: 1

Related Questions