Open Closed

Getting Error While Deploying to Azure , Please Help #4390


User avatar
0
Jatinder.singh created

While deploying on Azure iam getting the 500.03 error. and on Logs. I See

Application '/LM/W3SVC/803387773/ROOT' with physical root 'C:\home\site\wwwroot' has exited from Program.Main with exit code = '1'. First 30KB characters of captured stdout and stderr logs: [16:11:57 INF] Starting AllSolutions.HttpApi.Host. [16:12:01 FTL] Host terminated unexpectedly! Volo.Abp.AbpInitializationException: An error occurred during ConfigureServicesAsync phase of the module Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule, Volo.Abp.OpenIddict.AspNetCore, Version=7.0.0.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details. ---> System.Security.Cryptography.CryptographicException: Access is denied. at System.Security.Cryptography.X509Certificates.StorePal.FromSystemStore(String storeName, StoreLocation storeLocation, OpenFlags openFlags) at System.Security.Cryptography.X509Certificates.X509Store.Open(OpenFlags flags) at Microsoft.Extensions.DependencyInjection.OpenIddictServerBuilder.AddDevelopmentEncryptionCertificate(X500DistinguishedName subject) at Microsoft.Extensions.DependencyInjection.OpenIddictServerBuilder.AddDevelopmentEncryptionCertificate() at Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule.<>c__DisplayClass1_0.<AddOpenIddictServer>b__0(OpenIddictServerBuilder builder) at Microsoft.Extensions.DependencyInjection.OpenIddictServerExtensions.AddServer(OpenIddictBuilder builder, Action1 configuration) at Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule.AddOpenIddictServer(IServiceCollection services) at Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule.ConfigureServices(ServiceConfigurationContext context) at Volo.Abp.Modularity.AbpModule.ConfigureServicesAsync(ServiceConfigurationContext context) at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync() --- End of inner exception stack trace --- at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync() at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action1 optionsAction) at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action1 optionsAction) at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action1 optionsAction) at AllSolutions.Program.Main(String[] args) in D:\AllSolutions\aspnet-core\src\AllSolutions.HttpApi.Host\Program.cs:line 36

Process Id: 10560. File Version: 17.0.22292.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: bb01bbf4433e27289b99001b7de6a582879d1835

Please help me in getting this error resolved.


2 Answer(s)
  • User Avatar
    0
    ccernat created

    Hi!

    This is happening, I think, because you have to upload the encryption and signing certificates for OpenIdDict server. On local machine will work with development certificates, but on Azure it won't work anymore.

    Generate some certificates by making a new console app:

    Upload these certificates to Azure. Follow the documentation. Note the certificate thumbprints, you will need them later.

    In YourProjectHttpApiHostModule add:

    Also add two new methods for loading the certificates based on what OS is the web service published to:

    Now in appsettings.json add:

    Be careful to add them to Azure settings to and put as values the previously saved thumbprints.

    Should work.

  • User Avatar
    0
    gterdem created
    Senior .NET Developer

    Thank you.

    If uploading the .pfx file is not working for Azure, we'll try to update the template after we release the Azure Deployment docs.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 10, 2024, 06:38