I'm using PackageReference Include="Microsoft.Identity.Web.Certificate" Version="1.25.3" in my project. The application runs successfully on my local machine. However, when deployed to any environment in Azure, I encounter a ModuleInitializeException error. This error message states that "Azure.Identity" cannot be loaded for the module C:\home\site\platform\app_data\modules\TestModule.Web.dll.
Upon investigation, I found that the following libraries are missing in the Azure environment, causing the issue:
- Azure.Security.KeyVault.Secrets.dll
- Microsoft.Identity.Client.Extensions.Msal.dll
- Azure.Identity.dll
These libraries appear to be related to the Microsoft.Identity.Web.Certificate package. I have tried upgrading and downgrading the package version, but the issue persists. Any suggestions for resolving this error?