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.
3 Answers
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:
All in VS 2022.

- 1,564
- 16
- 30
-
I used it on Azure Function but it never got to the code when I ran the post from Postman. Is there another way I can start the code for Azure Functions? – Ofer Gal Nov 18 '21 at 18:47
-
@OferGal Can you clarify what you mean by 'start the code'? – Mr Patience Nov 20 '21 at 10:38
-
I mean something to test or debug the code running in Azure and find the error after sending the post from Postman – Ofer Gal Nov 20 '21 at 12:59
-
3Just now I found that in the "Publish" pane I can use "View streaming logs" and see the error as they happen – Ofer Gal Nov 20 '21 at 13:07
-
When I go to publish in debug mode, it throws an error: "ERROR_USER_NOT_AUTHORIZED_FOR_DEPLOYMENTPROVIDER" Works fine in Release mode. – Scuba Steve Sep 21 '22 at 06:01
-
A gotcha to consider: My app service was configured to allow debug for vs 2018 (its an old service... created circa 2013 and I have not had a reason to debug it for many years... until now... anyway. hope that helps someone.) – Hunter-Orionnoir Jul 11 '23 at 20:19
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.

- 231
- 3
- 7
-
I just wasted half a day because the document says 4026 but its actually 4024, thanks for your help – RichyRoo Jul 01 '22 at 03:00
-
This indeed works even when the menu command from Puiblish page does not work! – Andrii Jul 17 '22 at 17:17
Today with Visual Studio 2022 you can use the Connected Services
node under a given project:
Once you connect to an app service, you'll have access to attach the debugger:
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

- 100,159
- 46
- 371
- 480
-
Worth noting that this functionality is totally broken with ASP.NET classic in VS2022. It does not work at all. You can connect the app service under connected services, but it does nothing, zero actual functionality. – Scuba Steve Sep 20 '22 at 21:31
-