Azure.Identity exception thrown when using IIS local server

Marco Enxuto 326 Reputation points
2021-11-19T00:10:49.353+00:00

Hi,
I'm debugging a web app .net 5 on a local server using IIS.
The app uses Azure.Identity which is implemented by Dependency Injection at service start.
If i deploy the web app to Azure, the service uses Managed Identity and everything should work nicely.
This gets quite complicated when using locally, in this case the requirement is environment variables defined to be used by the service.

I applied the required values to the configuration in order to authenticate successfully:
AZURE_CLIENT_CERTIFICATE_PATH C:\Users\Public\cert.pfx
AZURE_CLIENT_ID (guid)
AZURE_TENANT_ID (another guid)

The app is throwing could not load the certificate file, is something i am missing here?
Do i need to add some kind of permission to IIS in order to get access to that path? I don't think so...

Also the i did follow the troubleshooting steps... don't know what to do more, in order to get the app authenticated....

Internet Information Services
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,664 questions
{count} vote

2 additional answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,931 Reputation points
    2021-11-19T02:32:09.807+00:00

    Be sure the certificate is not password protected.


  2. Marco Enxuto 326 Reputation points
    2021-12-07T00:18:50.957+00:00

    Just to update this question, there's the same question posted by me on GitHub.
    GitHub question

    0 comments No comments