Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote debugging Azure App Service with VS 2019

How do I enable debugging from VS2019 for my .NET app running in an Azure App Service? The portal only supports 2015 and 2017.

Remote debugging options

like image 793
Andy Sterland Avatar asked Apr 04 '19 23:04

Andy Sterland


People also ask

How do I debug Azure App Service in Visual Studio?

In Solution Explorer, right-click the project, and click Publish. In the Profile drop-down list, select the same profile that you used in Create an ASP.NET app in Azure App Service. Then, click Settings. In the Publish dialog, click the Settings tab, and then change Configuration to Debug, and then click Save.

How do I debug an app on Azure App Service?

Right-click your app in the App Service explorer and select Start Remote Debugging. This process requires that the app be restarted with the debugger enabled - you'll be prompted to confirm the restart. Once restarted, VS Code will connect to the app's debugging port via an SSH tunnel.


2 Answers

You can just connect from Visual Studio 2019 and it should all work without changing the portal settings.

  1. Open Visual Studio and your project
  2. Open Cloud Explorer View -> Cloud Explorer or ctrl+\, ctrl+x
  3. Find your App Service node in Cloud Explorer and select it
  4. Choose Attach Debugger from the context menu or the actions pane

Attach Debugger in Visual Studio

like image 155
Andy Sterland Avatar answered Oct 16 '22 00:10

Andy Sterland


The VS 2019 option doesn't display in the "Classic" Application settings screen, you will need to use the new Configuration menu, then choose the "General Settings" tab when the blade opens.

enter image description here

like image 29
AntLaC Avatar answered Oct 15 '22 23:10

AntLaC