I have upgraded asp.net core 1.1 to an asp.net core 2. It runs fine on the local server, but when I try to deploy it to an Azure hosted web app, I received the error:
An error occurred while starting the application. .NET Core
4.6.00001.0 X86 v4.0.0.0 | Microsoft.AspNetCore.Hosting version 2.0.0-rtm-26452 | Microsoft Windows 6.2.9200
Any ideas?
ANCM failed to start within the provided startup time limit. By default, the timeout is 120 seconds. This error can occur when starting a large number of apps on the same machine. Check for CPU/Memory usage spikes on the server during startup.
To access App Service diagnostics, navigate to your App Service web app or App Service Environment in the Azure portal. In the left navigation, click on Diagnose and solve problems.
Please add ASPNETCORE_DETAILEDERRORS = true
in app settings of your app, restart it and see the detailed error next time you load the url. That will help you fix it.
For example, error in my case was that I didn't have the managed identity of my API App configured to access the Key Vault to get the storage account and Cosmos DB keys. I used startup to inject the configured storage and cosmos db objects hence it was failing the moment I was starting my app.
When you've fixed the startup issue, don't forget to remove this setting as leaving it on could expose information about how the application works to visitors in the event of another error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With