dark-loop / functions-authorize

An ASP.NET Core based authentication and authorization middleware for HTTP triggered Azure Functions (In-Proc and Isolated)
Apache License 2.0
37 stars 4 forks source link

Running Azure functions with AAD Authentication broken due to update to the local azure function runtime #55

Closed josbol closed 3 months ago

josbol commented 3 months ago

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

josbol commented 3 months ago

The issue has been resolved with a fix by MS

artmasa commented 3 months ago

Thanks @josbol for the update