Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug Azure Functions on Azure Portal?

I have created an Azure function. Can i debug Azure Functions on Azure portal without visual studio?

I am passing a complex parameter as File Model, i have to see what's coming in parameter value in debug mode?

like image 597
Ravi Anand Avatar asked May 17 '17 19:05

Ravi Anand


3 Answers

There is no debug experience in the portal. Constrained to just the portal, you'll have to use log output to debug.

You might also look into the Azure Functions CLI which provides a local debugging experience. it doesn't require VS.

like image 157
mathewc Avatar answered Nov 14 '22 04:11

mathewc


For Azure Functions V1, you can attach debugger then debug from Visual Studio as the code runs inside csx script: https://markheath.net/post/remote-debugging-azure-functions

For Azure Functions V2, It seems there is no way till now but you can get massive logs and analytics based on your need.

Or may be you can find a way by uploading the debug version contains (.pdb files) and try to attach debugger. Check this:

https://github.com/Azure/Azure-Functions/issues/872

And i opened an issue here to ask about this:

https://github.com/Azure/Azure-Functions/issues/1051

I have another easiest solution It may feet in your issue or may not, I faced a situation that i want to test azure function webhook but that wouldn't work with localhost so the only solution for me is to test it after publishing and for that i was in need for debug on azure itself but there is another brilliant solution:

You can expose your localhost urls to the public by using many services and for example:

https://localtunnel.github.io/www/

Make sure that you installed nodejs, and follow the instructions to install the localtunel package globally through npm and then you can generate a public url for your localhost webhook so you can verify it against any third party and debug it.

like image 38
Marzouk Avatar answered Nov 14 '22 04:11

Marzouk


Through Azure Functions Portal you won't able to have debugging tools for do that.

But you can you some ways to debug your azure functions:

  • 1º) Remote debugging using Visual Studio IDE;
  • 2º) Local Debugging using both Visual Studio or VS Code, too;
  • 3º) Event though you're using Azure Functions CLI, you'll need some IDE, that is Visual Studio or VS Code;

The only way that there is on Azure Functions Portal to have something like a debugging is the LOG Window that is localized right below Function Code Window.

like image 44
Jose Roberto Araujo Avatar answered Nov 14 '22 05:11

Jose Roberto Araujo