Reputation: 99
I am deploying my ASP.NET Core 3.1 app to Azure App Service. While creating the new app service, I chose Linux as Operating System. In deployment center, when I deploy the app, it prompts me to enter a startup command. Everywhere I read about it it says startup command is optional. But when I deploy, it doesn't get further without this.
I have recently deployed other app services on windows and this was not the problem then. The startup command I am entering is dotnet <project.dll>. It deploys successfully. But after the deployment whenever I hit an API endpoint, it gives 500 Internal Server Error.
My question is: What is the purpose of startup command? Why is this returns with 500 when deployed to linux.
S
Upvotes: 6
Views: 18375
Reputation: 3398
It seems your startup command is correct refer to this.
You could check if this setting had been set already in Configuration, and check if the .dll file name is correct. As far as I known, this setting is necessary under Linux environment.
For 500 Internal Server Error, it's a error from server side, sometimes it means your web app is not prepared, and restart it would solve the problem.
If not solved, check the wwwroot file structure in kudu. ->.scm.azurewebsites.net If the file structure not correct, try another way to deploy.
As your own reply, you connected your app to database. If issue still here, try add sql server policy like this:
Upvotes: 6
Reputation: 99
I diagnosed the problem. My deployed app service is not whitelisted to access database. That is the reason for 500 Internal Server Error
Upvotes: 1