Mastering Azure Serverless Computing
上QQ阅读APP看书,第一时间看更新

Debug your function remotely

Using Visual Studio (or Visual Studio Code) you can attach your debugger directly to the deployed code.

To do this, you can use the Cloud Explorer extension (you can find it in Azure Marketplace or using the Manage Extensions menu option in Visual Studio). This extension allows you to browse the resources contained in your subscriptions and perform actions on them. In the case of the function app resource, it is possible to launch a remote debug session:

If you have permission to access the resource, Visual Studio attaches the debugger remotely to the function host process, starts it, and you can debug your function in the same way as you perform local debugging: you can set a breakpoint in the code that will be reached every time the function is triggered.