Remote debug Azure web job with .NET 6 in Visual Studio 2022

Viewed 81

I followed this tutorial to create a simple web job in Azure: https://docs.microsoft.com/en-us/azure/app-service/webjobs-sdk-get-started. The web job itself does its job, consumes the message in the queue and I see them appear in Application Insights. However, I want to debug the function on my local machine by using the tools available in Visual Studio 2022.

I have published with following profile settings:

Profile settings

Next I've attached the debugger under het Hosting menu:

Attaching debugger

First thing I noticed is a message about no symbols being loaded when putting a breakpoint in the function:

No symbols have been loaded for this document

When I add a message to my queue, it gets consumed by the web job but the breakpoint is never hit. I've been reading a lot of similar questions regarding a this issue but I'm not progressing any further.

  • In Azure Portal, I've enabled Remote debugging under Configuration > general settings Enable remote debugging in Azure Portal

  • In Visual Studio 2022, I checked if the correct process is attached Attached processes in Visual Studio 2022 Here I'm a bit confused thou, the connection target is connecting through port 4024, which is according to this document, the port for Visual Studio 2019. However, a connection target with port 4026 is not found.

What am I missing here? Am I forgetting another setting somewhere?

If have tried changing the stack setting .NET version from APS.NET V4.8 to NET 6 (LTS) but that didn't help.

stack settings

Should the platform architecture match the architecture of my machine in order to get it to work? Or is this not linked in any way with the debugger?

platform architecture

Is there anything else that I should check or try? Because my hair is turning grey here :)

0 Answers
Related