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.
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