Running Azure functions locally with AAD Authentication broke all of the sudden.
This is not a problem with this project, but people might come here to wonder what is going on.
An update to the local Function Runtime references the 7.x version of the Microsoft.IdentityModel libs (was 6.x). This breaks the AAD authentication and will generate an error like the one below:
The error you'll encounter:
[2024-06-24T12:19:41.079Z] Error configuring services in an external startup class. [2024-06-24T12:19:41.081Z] Error configuring services in an external startup class. System.Private.CoreLib: Could not load type 'Microsoft.IdentityModel.Json.JsonObjectAttribute' from assembly 'Microsoft.IdentityModel.Tokens, Version=7.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. [2024-06-24T12:19:42.268Z] A host error has occurred during startup operation '0ab8afa3-1de5-4d45-993b-d936340e3075'. [2024-06-24T12:19:42.270Z] Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class. System.Private.CoreLib: Could not load type 'Microsoft.IdentityModel.Json.JsonObjectAttribute' from assembly 'Microsoft.IdentityModel.Tokens, Version=7.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Value cannot be null. (Parameter 'provider')
Running Azure functions locally with AAD Authentication broke all of the sudden.
This is not a problem with this project, but people might come here to wonder what is going on.
An update to the local Function Runtime references the 7.x version of the Microsoft.IdentityModel libs (was 6.x). This breaks the AAD authentication and will generate an error like the one below:
The error you'll encounter: [2024-06-24T12:19:41.079Z] Error configuring services in an external startup class. [2024-06-24T12:19:41.081Z] Error configuring services in an external startup class. System.Private.CoreLib: Could not load type 'Microsoft.IdentityModel.Json.JsonObjectAttribute' from assembly 'Microsoft.IdentityModel.Tokens, Version=7.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. [2024-06-24T12:19:42.268Z] A host error has occurred during startup operation '0ab8afa3-1de5-4d45-993b-d936340e3075'. [2024-06-24T12:19:42.270Z] Microsoft.Azure.WebJobs.Script: Error configuring services in an external startup class. System.Private.CoreLib: Could not load type 'Microsoft.IdentityModel.Json.JsonObjectAttribute' from assembly 'Microsoft.IdentityModel.Tokens, Version=7.1.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Value cannot be null. (Parameter 'provider')
Microsoft is actively working on a fix.
Thread to monitor: https://github.com/Azure/azure-functions-core-tools/issues/3715