New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Dependency on System.Diagnostics.DiagnosticSource (>= 7.0.2) in version 4.58.0 missing in .NET 6 Azure Functions #4456
Comments
@Ozindar Does this repro if you try .NET 7 or 8 Azure Function? Can DiagnosticSource package be used in Azure Functions in general? For ex, in your app can you target MSAL 4.57 and just add a reference to DiagnosticSource v6.0.0, will that work? |
@Ozindar I wasn't able to repro. I created and published a .NET 6 HTTP Trigger Function with MSAL 4.58.1. Tried with framework-dependent and self-contained deployment modes, portable and win-x86 runtimes, integrated and classic pipelines. App compiled and ran fine. Please provide and repro and more details on any related deployment settings that can help repro. |
We have met the same errors in Azure Functions. |
We will investigate. For now stick to MSAL 4.57, as it does not have this dependency. |
Thanks @Dolphinsimon. Seems like it's not a compile-time or publish error, but a runtime error, as I was able to publish successfully but didn't try running MSAL. |
It's because Azure functions don't run the application with the references that you build. We have the same issue with IdentityModel |
@pmaytak Yes, Azure Function will clean the output libraries before publishing to the cloud. If the library was already in the function runtime, then the library will be deleted. For this issue, the System.Diagnostics.DiagnosticSource is in the function .NET runtime, but the version is not 7.0.2, the .NET v4 runtime is only support .NET6.0 libraries, the version is 6.x. |
@GeoK @neha-bhargava - do you know if System.Diagnostics.DiagnosticSource version 6.x would work instead of version 7.x for the MSAL scenarios? |
Seems to be a known issue with Azure Functions. Looking for workarounds.... We are looking at disabling the OTEL functionality if this exception occurs, as it is not critical. |
@Ozindar @Dolphinsimon MSAL 4.59.0 was released that references DiagnosticSource 6.0.1. |
Discussed in https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/discussions/4455
Originally posted by Ozindar December 6, 2023
We've got a .NET 6.0 Azure Function using the Identity.Client. This worked fine with 4.57. With a recently deploy we've upgraded to 4.58 but in Azure this triggers a File not found when it's searching for the DiagnosticsSource version 7 assembly.
"dotnet publish" does not seem put that dll in the output folder. For the moment I've pinned the Identity.Client to 4.58.
Is there a viable solution to keep using the latest Identity.Client in combination with a .NET6 Azure Function and what would be the best approach?
The text was updated successfully, but these errors were encountered: