1. Create and deploy Azure Functions from Visual Studio Code

In this tutorial, create a new serverless app in Visual Studio Code with extensions and JavaScript, then deploy the application to the Azure cloud for hosting with a public HTTP endpoint.

Prepare you development environment

Install the following software:

The following software is installed as part of the tutorial later:

Sign in to Azure in Visual Studio Code

If you already use the Azure service extensions, you should already be logged in and can skip this step.

Once you've installed an extension in Visual Studio Code, you need to sign into your Azure account.

  1. In Visual Studio Code, select the Azure explorer icon, then select Sign in to Azure, and follow the prompts.

    Sign in to Azure through VS Code

  2. After signing in, verify that the email address of your Azure account appears in the Status Bar and your subscription(s) appears in the Azure explorer:

    VS Code Azure explorer showing subscriptions

Note

If you see the error "Cannot find subscription with name [subscription ID]", this may be because you are behind a proxy and unable to reach the Azure API. Configure HTTP_PROXY and HTTPS_PROXY environment variables with your proxy information in your terminal:

export HTTPS_PROXY=https://username:password@proxy:8080
export HTTP_PROXY=http://username:password@proxy:8080

Install the Azure Functions Core Tools V3

  1. In VS Code, open the integrated terminal at a location you want to create and run the local project.

  2. Install Azure Functions Core Tools locally:

    npm install --global azure-functions-core-tools@3 --unsafe-perm true --save-dev
    

Next steps