Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error after deploying asp.net core app to azure

After deploying my asp.net core app to azure for the first time and ran it, I got the following error:

Error. An error occurred while processing your request. Development Mode Swapping to Development environment will display more detailed information about the error that occurred.

Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.

Please note that I tried debug and release mode when publishing in visual studio and I made sure that I chose the default migration and have the connection string as well. If possible, can you tell me how to enable development mode as shown or explain the error further? Thank you

Edit: As per the suggestion I received I found the following in cloud explorer log:

Msvsmon was unable to start a server named '127.0.0.1:50867'. The following error occurred: An instance of the remote debugger is already running on this computer, or another process is already bound to the specified TCP/IP port.

like image 576
Techy Avatar asked Nov 19 '16 19:11

Techy


People also ask

How do I check Azure App Service errors?

Detailed Error Logs Another way to view the failed request traces is to navigate to your app page in the portal. From the left menu, select Diagnose and solve problems, then search for Failed Request Tracing Logs, then click the icon to browse and view the trace you want.

How do I troubleshoot Azure App Service?

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.


2 Answers

Just so it's clear - still something that comes up in ASP.NET Core 2.0 - and as @Techy stated - is in Azure. Go to Azure, click on your Web App –> "Applications Settings" –> go down to the “App Settings” section and add the “ASPNETCORE_ENVIRONMENT” and “Development”

Azure Portal

like image 150
Lance Larsen - Microsoft MVP Avatar answered Sep 30 '22 06:09

Lance Larsen - Microsoft MVP


thanks for your comments. I was able to find error details by adding the following key in application settings in azure portal: ASPNETCORE_ENVIRONMENT with value: Development

I have created a new question regarding the error itself: InvalidOperationException: Could not find 'UserSecretsIdAttribute' on assembly

Thank you

like image 22
Techy Avatar answered Sep 30 '22 05:09

Techy