Deploy Azure Functions from Visual Studio Code

In this tutorial, you use Visual Studio Code and the Azure Functions extension to create and deploy an Azure Functions application written with JavaScript.

Walkthrough video

Watch this video for a complete walkthrough of the content in this article.


Install the Azure Functions extension

Azure subscription

If you don't have an Azure subscription, sign up now for a free account with $200 in Azure credits to try out any combination of services.

Sign in to Azure

Once you've installed the Azure extension in VS Code, sign into your Azure account by navigating to the Azure explorer, select Sign in to Azure, and follow the prompts. (If you have multiple Azure extensions installed, select the one for the area in which you're working, such as App Service, Functions, etc.)

Sign in to Azure through VS Code

After signing in, verify that the email address of your Azure account (or "Signed In") appears in the Status Bar and your subscription(s) appears in the Azure explorer:

VS Code status bar showing Azure account

VS Code Azure explorer showing subscriptions


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

To enable local debugging, you need to install the Azure Functions Core Tools, which can be done directly in Visual Studio Code.

  1. Start Visual Studio Code.

  2. Open the Command Palette (F1), enter Azure Functions: Install or Update Azure Functions Core Tools, and press Enter to run the command.

  3. To verify installation, select the menu command Terminal > New Terminal in VS Code, then run the command, func. The command should show output like that below (along with usage information).

                 @   %%%%%%    @
               @@   %%%%%%      @@
            @@@    %%%%%%%%%%%    @@@
          @@      %%%%%%%%%%        @@
            @@         %%%%       @@
              @@      %%%       @@
                @@    %%      @@
     Azure Functions Core Tools (2.4.419 Commit hash: c9c1724d002bd90b2e6b41393915ea3a26bcf0ce)
     Function Runtime Version: 2.0.12332.0