In the latest AL Language extension for the 2026 release wave 1 release (runtime 17.0) Microsoft introduced the possibility to debug agent sessions from Visual Studio Code.
With this 17.x release it’s possible to attach to agent sessions and debug the AL code they are executing. To do so, the new client type Agent has been introduced along with two new launch configurations to attach to an agent session on a cloud sandbox or your own server.
To debug an agent session in a cloud sandbox, you can use the following configuration (passing the security ID of your agent configuration):
To debug an agent session in your on-premise environment, you can use the following configuration:
With these configirations the snapshot debugging will stop at the next agent session identified by the specified user security id. You can also use the sessionId parameter to connect to the specific agent session. In this way you can inspect what an agent is doing in your application (because also AI sometimes must be monitored 😜).
You will learn more about agents in Dynamics 365 Business Central in the next weeks. In the meanwhile, I refresh you with this:




Hi Stefano,
Have you had a chance to try this yourself yet?
Unfortunately, it’s not working on my side. I updated the
launch.jsonas described above and also specified the agent user’s Security ID. The user is displayed correctly in the output, so that part seems to be working.However, the debugger never attaches to the agent session, even when I deliberately trigger an error within the agent.
I have one more question regarding on-premises environments:
What exactly does agent debugging look like in that scenario? As far as I understand, the Microsoft Agent Framework cannot be used in an on-premises environment, so I’m curious how debugging is expected to work there.
Thanks in advance!
Best regards
LikeLike
Debugging agent session is currently broken 😡 Microsoft is on the issue and working on this. Regarding onprem, simply this is not supported.
LikeLike
Thanks for the quick reply. I have a quick update 🙂
When I look up the agent session ID in the Admin Center and add it to launch.json, it works for me.
LikeLike