Try reloading this page, or reviewing your browser settings
This video segment demonstrates debugging Azure functions in VSCode.
- Azure Functions
- Visual Studio Code
About this video
- Sahil Malik
- First online
- 20 December 2019
- Online ISBN
- Copyright information
- © Sahil Malik 2019
Sahil Malik: Let’s talk about the development and debugging experience using VSCode for Azure Functions. So this is what a typical generated Azure Function code project looks like in VSCode. I just generated this, now let’s look at the development and debugging experience. Development is fairly straightforward. I can choose to add more functions here as I wish. This function app can contain more than one function. I can go here, I can click this button to add more functions. Just feel free to play with that. I’m not going to do that because that’s fairly straightforward. Also in this here, I don’t quite have intellisense because this is not TypeScript, it doesn’t have a .d.ts file, but I get some level of intellisense, whatever VSCode can understand. For instance, it sees a property here called req.query, so when I type req., so you see that it understands some of these things. It’s just trying to guess and help me out. So if you did write a .d.ts file here, then you’d get proper intellisense here as well. It doesn’t generate that out of the box for you.
So here we go. It went ahead and started this HttpTrigger over here. This font can be fixed in the settings of VSCode but it’s legible so I’ll leave that as is because it’s technically not part of Azure Functions. Now I can go ahead and hit control click to follow this link. Let’s click on that. And as you see over here that now I’m in debug mode and I can hit F10 or I can step over like this and I can basically debug this as I feel. Hit continue and basically these results come out here. The debugger is still attached and I can see the results come out here.
Okay, now the important point to take home over here is that everything running here is not running on Azure. It is running on my local machine. So I can completely debug this, build this function, complicated logic right here on my local machine. I don’t even need to put this in Azure. When I’m ready to deploy it is when we start worrying about the next step which is the deployment experience. When you’re done debugging, hit this button here and now you’re not debugging anymore.