Create Azure Function using Visual Studio Code and PowerShell

In this Azure tutorial, we will discuss Create Azure Function using Visual Studio Code and PowerShell.

Subscribe to Our YouTube Channel for more videos

Create Azure Function using Visual Studio Code and PowerShell

Well, here we will discuss Create Azure Function using Visual Studio Code. Before that, We should know the Prerequisites needed or the things needed to Set Up Your Environment to start with the development activity.

Set Up Your Environment to Create function app in Visual Studio Code

Prerequisites

Below are the things needed before you start to Build Your First Azure Function in Visual Studio Code.

  • The first thing we need is an Azure Account or Azure Subscription. If you don’t have an Azure Account till now, create an Azure Free Account now.
  • Visual Studio Code needs to be installed. If you don’t have Visual Studio Code installed on your machine, then install Visual Studio Code now.
  • The Azure Function Extensions for the Visual Studio Code.

How To Create Azure Functions In Visual Studio Code

Now that we have everything needed for the development activities Let’s start the actual development. Follow the below steps to Create Azure Functions using Visual Studio Code.

1. Open the Visual Studio Code in our local System and click on the Extensions button from the left side. Now search for the Azure Functions and then click on the Install button below to install the Azure Functions extension in the Visual Studio Code.

edit existing azure function in visual studio code

2. Now you can see that Azure Functions extensions have been installed successfully.

create function app in visual studio code

3. Now click on the Azure button from the left side and then click on the Create New Project icon from the top, as shown below.

edit azure function in visual studio code

4. Now, click the Browse button on the Create a new project window to select a Project location.

create azure function in visual studio code

5. Now, select a language to build the Azure Function; I am choosing the language option here as C#. The available language options are Javascript, TypeScript, C#, Python, Java, and PowerShell.

Create Azure Functions using Visual Studio Code

Build an HTTP Trigger Azure Function

6. Now, you need to select a trigger for your Azure Function. I will choose the option of HTTP Trigger.

Develop Azure Functions using Visual Studio Code

7. Provide the Function name and click on the Enter button. Now it will ask for the NameSpace name, and then click the Enter button in the next window.

visual studio code azure functions c#

8. Select the AccessRights option as Anonymous on the Create new HTTP Trigger window.