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.
Application Event Logs -> Error PackageReference
Upon investigation, I found that the following libraries are missing in the Azure environment, causing the issue:
Azure.Security.KeyVault.Secrets.dllMicrosoft.Identity.Client.Extensions.Msal.dllAzure.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? Missing Libraries

.csprojfile<CopyLocalFileAssemblies>true</CopyLocalFileAssemblies>in <PropertyGroup> tag of your csproj file