Web API Error - HTTP Error 500.30 - ANCM In-Process Start Failure After publishing to Azure

Aswin Draco 1 Reputation point
2022-08-09T06:42:10.277+00:00

Hello dev people,

I am facing this issue After deploying the API to a newly created Azure Windows App service "HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure"
Looking up online, i went to Development Tools > Console and tried to run the dll file using dotnet {projectname.dll} and it returned the below error :

Host terminated unexpectedly
System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.
To generate a developer certificate run 'dotnet dev-certs https'. To trust the certificate (Windows and macOS only) run 'dotnet dev-certs https --trust'.

and ofcourse i tried to install the certificate using

dotnet dev-certs https --clean
dotnet dev-certs https
dotnet dev-certs https --trust

On running the last 2 commands, i am getting the error:
There was an error saving the HTTPS developer certificate to the current user personal certificate store.

free App Service managed SSL Certificate is already installed on the custom domain that is linked to the api.

I've tried all solutions. Let me know if you guys know how to fix this.

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,208 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,957 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,931 Reputation points
    2022-08-09T15:36:42.797+00:00

    the dev certificates generated by dotnet are only for use on your local development box. you can not use them on a host. for a host you need to configure the host:

    https://learn.microsoft.com/en-us/azure/app-service/configure-ssl-certificate?tabs=apex%2Cportal

    0 comments No comments

  2. ajkuma 22,521 Reputation points Microsoft Employee
    2022-08-22T09:24:11.373+00:00

    @Aswin Draco , Just following up, checking in to see if the previous post helped answer your question or point you in the right direction. To benefit the community, find the right answers, please do mark the post which was helpful by clicking on Accept Answer’.

    Adding to Bruce-SqlWork’s suggestions. This is a generic error (HTTP Error 500.30), and there could be multiple causes, but it’s not related to App Service Managed Certificate (ASMC).

    To be better prepared for this in case it should happening/happens again, I suggest you enable standard output logs (stdout logs).

    • STDOUT Logs are very helpful to diagnose issues – especially issues related to application startup. If you set stdoutLogEnabled to true ASP.NET Core Module will write all the output written by the application to the console to the stdoutLogFile file. This will give us precise information if this error occurs again. All you have to do is to navigate to %home%\LogFiles\stdout , and download the log file.
    • Navigate through Kudu site on: https://<sitename>.scm.azurewebsites.net/api/logs/
    • Eable stdout logs in the /site/wwwroot/web.config of the application by changing the line of <aspNetCore stdoutLogEnabled="true" stdoutLogFile="\home\LogFiles\stdout" ... >… Note: Using the stdout log is only recommended for troubleshooting app startup issues when hosting on IIS /or on App Service.
    • Additionally, just to isolate, try changing the ASP.NETCORE hosting model from InProcess to OutOfProcess as described below: In the file MyProject.csproj
      Change this line
      <AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
      For this
      <AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>

    Reference: troubleshoot-diagnostic-logs

    The ASP.NET Core Module attempts to start the .NET Core CLR in-process, but it fails to start. The cause of a process startup failure can usually be determined from entries in the Application Event Log and the ASP.NET Core Module stdout log.

    • You may leverage App Service diagnostics from Azure Portal> Navigate to your App Service app in the Azure Portal.
      In the left navigation, click on Diagnose and solve problems – Checkout the tile for “Diagnostic Tools” > “Availability and Performance” & "Best Practices" and review to fetch additional information to isolate further.

    More Info:
    Troubleshoot ASP.NET Core on Azure App Service and IIS