One excellent feature that Azure Functions provides is that we can debug our Azure functions with the help of Visual Studio IDE or Visual Studio Code. This article will discuss how to do this using both IDEs.
Table of Contents
How to debug Azure Function locally in Visual Studio
Now, we will discuss how to debug a function app using Visual Studio 2019.
You can easily debug your Azure function by putting a breakpoint in your Azure function code and then run your Azure Function project by pressing F5. Now you will get the Azure Function URL, you try accessing the URL in any of your favorite Browsers. Once you put the URL in the Browser, hit the Enter button. You can able to see it will hit the debugger in your code. Let’s check this complete debugging scenario
Now, put the debugger in your Azure Function code as shown below

The next step is to run the Azure Function Project by pressing the F5 button and copying the Function URL you will get after the successful execution of the project. You can see below I got the function URL as below
http://localhost:7071/api/HTTPAzureFunction. Copy this URL.

Now Open your Browser and try accessing the URL

Now you can see that After you try accessing the Azure Function URL, it hits the breakpoint in the Azure Function code.

So, we saw it is cool to debug the Azure function using Visual Studio 2019. It is even more interesting to debug multiple function apps in Visual Studio 2019. Let’s check that scenario.
Debugging Multiple Azure Function Apps In Visual Studio 2019
Visual Studio 2019 can’t launch multiple apps to debug at the same time, But as a workaround, what you can try out is that you can launch one and then attach it to the others. Let’s do that following the below steps
First, Put the breakpoint in both the Functions like below
Here is my first function, where I have put the breakpoint inside the function

Below is my second function, and I have put the breakpoint there.

The next step is to start the first function app without debugging. Click on the Debug –> Start Without Debugging or press Ctrl + F5.

Then, start the second function app with the debugger. Click on the Debug –> Start Debugging or press the F5 button.

Now, you must attach the debugger to the First Azure Function App. You need to click the Debug –> Attach to Process.

Now, on the Attach to Process window, search for the func.exe. You can see two entries. Select the one not greyed out and then click the Attach button.

Now, if you try accessing both the URLs, i.e., http://localhost:7071/api/HTTPAzureFunction and http://localhost:5860/api/Function1, you can see it will hit the respective breakpoints inside the Azure Functions.
How to Debug Azure Function locally in Visual Studio Code
Well, we can able to debug the Azure function in Visual Studio Code using simple steps
Put the debugger in the Azure Function as shown below

Now, Navigate to the Browser where you are trying to Browse the Function URL with the query string parameter value. The URL is http://localhost:7071/api/Mynewfunction2?name=raj. You need to refresh the Browser or select the URL and hit Enter Button. Now, if you go back and check the Function where you put the Breakpoint earlier, it will hit the debugger, and if you mouse over on the name parameter, you can see the Value as “raj” there. Refer to the above screenshot for more clarity.

You can also check out the below articles
- How To Deploy Function App In Azure Portal
- How To Create Azure Functions In Visual Studio
- Create Azure Function using Visual Studio Code and PowerShell
Wrapping Up
This Azure article discussed how to debug Azure Function locally using Visual Studio and Visual Studio Code. Thanks for taking the time to read this article !!!


I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
