Terry151151
Terry151151

Reputation: 761

Visual Studio 2022 Debug On Remote Azure Server

I appears that the Cloud Explorer has now been retired in Visual Studio 2022. This was something that I used many time a day and will sorely be missed. I used to be able in the Cloud Explorer select the app service, right click, and attach the debugger to the app. In Visual Studio 2022 I can find no way of attaching the debugger the the remote Azure app service. Also browsing the web I can't find any documentation on how to do this. Can someone supply directions on how to do this, or point me to the documentation on how to debug an Azure app on the remote server.

Upvotes: 23

Views: 16104

Answers (3)

yosh
yosh

Reputation: 283

I’ve had the same problem, trying to do remote debug an App Service with VS2022. I just realised that the top dropdown box “Connection Type” on Debug | Attach to Process... dialog gives you an option “Microsoft Azure App Services” (I'm using ver 17.2.4). Clicking the Find button lets you select target App Service. You can then select the target process. (Attaching from the Publish dialog doesn’t let you select the process - you may have a number of apps on virtual directories).

One thing I noticed and confusing; the listening port is not 4026 but 4024 even though you specify VS2022 on the Azure Portal in my case. Telnet or Psping to 4026 – no response. If you do the above way, this doesn’t matter but if you select Connection Type: “Default” and specify host:port, then the port should be 4024. You can remotely debug Azure Function in this way.

Upvotes: 13

Leniel Maccaferri
Leniel Maccaferri

Reputation: 102368

Today with Visual Studio 2022 you can use the Connected Services node under a given project:

enter image description here

Once you connect to an app service, you'll have access to attach the debugger:

enter image description here

Microsoft Learn Module

Remotely debug ASP.NET Core apps hosted on Azure App Service using Visual Studio

More info here:

Manage the resources associated with your Azure accounts in Visual Studio Cloud Explorer

Overview: Connected Service

Upvotes: 5

Mr Patience
Mr Patience

Reputation: 2180

Currently there's an option to debug Azure App Service.
Instead of using the cloud explorer you may create a publish profile and attach a debugger from there:

enter image description here

enter image description here

enter image description here

All in VS 2022.

Upvotes: 34

Related Questions