0

I have an ASP.NET Core app and trying to automate deployment to a Linux-based Azure App Service through the on-premises Azure DevOps server. I managed to build everything and deploy the code to the App Service.

At this moment, the Startup Command which should run the application (dotnet dllname) fails. When I open the URL of my web app, I see the default Azure "welcome" page (served from opt/defaultsite).

I don't have a problem with this particular failure - I did not configure the connection string and other settings yet, so it was expected. However, I wonder how it is supposed to handle such failures. I have these concerns:

  1. How do I know that the startup failed without visiting the web app manually? The Deploy task finishes successfully with a green mark despite the fact that the startup was not successful.
  2. When the app fails to start, I would like to see the error message in the browser rather than the default site (at least for the non-prod environments). Otherwise, the only way to understand that I have a problem and see the reason is to go to the Kudu console and see the log stream.
  3. If my app crashes, would it restart it or it will switch to the opt/defaultsite page again?

At this moment, to address the first concern, I am going to add another task to the Stage - a simple PowerShell script which would send a request to one of the app endpoints, however, I wonder if Microsoft suggests some better/more native solution.

Andrew Simontsev
  • 1,078
  • 9
  • 18

1 Answers1

0

Basically, the stage will be failed if there are errors/exceptions during the deployment.

However we cannot fail an Azure Release Pipeline stage if startup command is not successful, because the deployment is actually complete.

As a workaround you can add another task to run scripts to request the endpoints to detect that as you did.

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55