The error you’re encountering ModuleInitializeException
is related to missing dependencies of the Microsoft.Identity.Web.Certificate
package.
<PackageReference Include="Azure.Security.KeyVault.Secrets" Version="4.4.0" />
<PackageReference Include="Microsoft.Identity.Client.Extensions.Msal" Version="3.0.0" />
<PackageReference Include="Azure.Identity" Version="1.9.0" />
.csproj
file is properly configured to copy all necessary files to the output directory..csproj
file<PropertyGroup>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
This setting ensures that all DLLs are copied to the output folder when building locally or in CI/CD.
Now after making the above changes I can see the DLLs in my Azure Web App.