I finally found out how to do this. You have to go to Azure portal and to the cloud service WorkerRole in Roles and Instances and click Connect. This sets up a remote desktop where you have to install the Remote Tools and run msvcmon.exe. Then you have to go to the machine where you enable RemoteDesktop, enter login and pwd, and Publish (extended). Then go to Debug=> Attach To Process and enter the Connection Target with ip of service and port 4024 (or whatever you selected). You then should be able to read Debug messages and set breakpoints on the cloud service.
How do you remotely debug an Azure cloud service extended from Visual Studio?
Before migrating from a classic cloud service to extended I was able to remotely debug the cloud service from Visual Studio 2019. Now the Server Explorer does not display the migrated service so can not attach debugger from there. Other methods of attaching to debugger described in the documentation do not work. Please elaborate.
4 answers
Sort by: Most helpful
-
-
Sedat SALMAN 13,985 Reputation points MVP
2024-05-10T03:19:37.6333333+00:00 there is an official Microsoft documentation to follow
the most critical different between vs 2022 and vs 2019
you need to be careful about remote debugger port assignment
-
kobulloc-MSFT 26,346 Reputation points Microsoft Employee
2024-06-03T19:13:52.2033333+00:00 Hello, @Glenn Rockland ! We've received your feedback and want to make sure that your question has been answered.
How do you remotely debug Azure Cloud Services (extended support) from Visual Studio?
We confirmed remote debugging with a worker role using the latest release of Visual Studio 2022 following the documentation. During testing, we put in <ipaddress>:4026 in the Debug->Attach To Process dialog and successfully connected after a short wait.
There are a couple things to note:
- Use port 4026 for Visual Studio 2022
- Build in debug
- Endpoint defined for 4026 in the .csdef file.
- Run MSVSMon.exe as Administrator
If you are still running into issues after checking the notes, there are likely network restrictions that require troubleshooting. We were unable to ping the IP address as well, so the server is likely not setup to respond to ping by default.
I hope this has been helpful! Your feedback is important so please take a moment to accept answers.
If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!
-
kobulloc-MSFT 26,346 Reputation points Microsoft Employee
2024-06-04T21:09:56.1133333+00:00 Hello, @Glenn Rockland !
I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.
Issue:
Before migrating from a classic cloud service to extended I was able to remotely debug the cloud service from Visual Studio 2019. Now the Server Explorer does not display the migrated service so can not attach debugger from there. Other methods of attaching to debugger described in the documentation do not work.
Solution (by Glenn Rockland):
I finally found out how to do this. You have to go to Azure portal and to the cloud service WorkerRole in Roles and Instances and click Connect. This sets up a remote desktop where you have to install the Remote Tools and run msvcmon.exe. Then you have to go to the machine where you enable RemoteDesktop, enter login and pwd, and Publish (extended). Then go to Debug=> Attach To Process and enter the Connection Target with ip of service and port 4024 (or whatever you selected). You then should be able to read Debug messages and set breakpoints on the cloud service.
List format:
- Go to the Azure portal
- Go to Cloud Service WorkerRole in Roles and Instances
- Click Connect. This sets up a remote desktop where you have to install the Remote Tools and run msvcmon.exe.
- Go to the machine where you enable RemoteDesktop.
- Enter login and pwd, and Publish (extended)
- Go to Debug=> Attach To Process and enter the Connection Target with ip of service and port 4024 (or whatever you selected)
You then should be able to read Debug messages and set breakpoints on the cloud service.
If you have any other questions or are still running into more issues, please let me know. Thank you again for your time and patience throughout this issue.
Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution. Thank you for helping to improve Microsoft Q&A!