Vinayak Jogade
Vinayak Jogade

Reputation: 1

Debugging Azure function V1.0

I have created one Azure function (V1) and published it with settings.

This function triggered ON when there is some blob in the queue.

My function processes the blob data based on business logic.

I have created monitoring tool to capture logs written in the business logic. So, I could found out the method, throwing exception from the logs.

However, I can't figure out line of code from that method which is throwing the exception.

I have seen couple of ways to remote debug the function code. But, to connect the function and hit the breakpoint is taking too much time (nearly two hours). Further, line by line debugging code also taking too much time. Hence, I serached in forum for different ways to quick debug the function. Found one good article-

http://dontcodetired.com/blog/post/Remote-Debugging-Azure-Functions-V2-The-breakpoint-will-not-currently-be-hit-No-symbols-have-been-loaded-for-this-document

which minimizes efforts of attaching process automatically. Through this steps, manually you can attach to the process and debug the code. However, when I publish the function (which they recommend) and attached to proper process, breakpoint doesn't get hit and blob from queue gets processed, eventhough all symbols are loaded. So, can anyone tell me what could be the wrong steps, I carried out ?

Or is there any other simplest way to debug the function from VS2017, quickly ?

I tried with Cloud debugging, but it takes too much time to hit breakpoint. And it break after some times.

Upvotes: 0

Views: 265

Answers (1)

rickvdbosch
rickvdbosch

Reputation: 15621

Have a look at running (and debugging) the Function locally.
For this you need to Work with Azure Functions Core Tools

Azure Functions Core Tools lets you develop and test your functions on your local computer from the command prompt or terminal. Your local functions can connect to live Azure services, and you can debug your functions on your local computer using the full Functions runtime. You can even deploy a function app to your Azure subscription.

And

Version 1.x: supports version 1.x of the runtime. This version of the tools is only supported on Windows computers and is installed from an npm package. With this version, you can create functions in experimental languages that are not officially supported.

Upvotes: 1

Related Questions