IIS of Azure VM cannot access Azure Secrets

Visitor

Hi,

I created an Azure key vault and i want to use it in my web service that i hosted it on IIS in an azure virtual machine.
it works on visual studio and service can obtain the secret but once i hosted it on IIS,this is the response 

HTTP Error 500.30 - ANCM In-Process Start Failure.
Note:
I already created a manged identity for the virtual machine and access granted to key vault.
Azure.PNG

 please advise

2 Replies

@Mahmoud_94 is this a .NET Core web api?  If so, you'll need to change the CLR version of the App Pool to No Managed Code.

 

If you right click on the App Pool and choose Basic Settings, you can then change the .NET CLR version to "No Managed Code".

 

The following link may help - Host ASP.NET Core on Windows with IIS | Microsoft Docs

 

It's also worth making sure your web service has it's own App Pool and that the ASP.NET Core Runtime hosting bundle is installed on the VM.