Quickstart: Building your first static site with Azure Static Web Apps

Azure Static Web Apps publishes a website by building an app from a code repository. In this quickstart, you deploy an application to Azure Static Web apps using the Visual Studio Code extension.

If you don't have an Azure subscription, create a free trial account.


Create a repository

This article uses a GitHub template repository to make it easy for you to get started. The template features a starter app used to deploy using Azure Static Web Apps.

  1. Navigate to the following location to create a new repository:
    1. https://github.com/staticwebdev/vanilla-basic/generate
  2. Name your repository my-first-static-web-app


Azure Static Web Apps requires at least one HTML file to create a web app. The repository you create in this step includes a single index.html file.

Select Create repository from template.

Create repository from template

Clone the repository

With the repository created in your GitHub account, clone the project to your local machine using the following command.

git clone https://github.com/<YOUR_GITHUB_ACCOUNT_NAME>/my-first-static-web-app.git

Make sure to replace <YOUR_GITHUB_ACCOUNT_NAME> with your GitHub username.

Next, open Visual Studio Code and go to File > Open Folder to open the cloned repository in the editor.

Install Azure Static Web Apps extension

If you don't already have the Azure Static Web Apps extension for Visual Studio Code extension, you can install it in Visual Studio Code.

  1. Select View > Extensions.
  2. In the Search Extensions in Marketplace, type Azure Static Web Apps.
  3. Select Install for Azure Static Web Apps.
  4. The extension will install into Visual Studio Code.

Create a static web app

  1. Inside Visual Studio Code, select the Azure logo in the Activity Bar to open the Azure extensions window.

    Azure Logo


    You are required to sign in to Azure and GitHub in Visual Studio Code to continue. If you are not already authenticated, the extension will prompt you to sign in to both services during the creation process.

  2. Under the Static Web Apps label, select the plus sign.

    Application name


    The Azure Static Web Apps Visual Studio Code extension streamlines the creating process by using a series of default values. If you want to have fine-grained control of the creation process, open the command palette and select Azure Static Web Apps: Create Static Web App... (Advanced).

  3. The command palette opens at the top of the editor and prompts you to select a subscription name.

    Select your subscription and press Enter.

    Select an Azure Subscription

  4. Next, name your application.

    Type my-first-static-web-app and press Enter.

    Create Static Web App

  5. Select a region close to you.


    Azure Static Web Apps globally distributes your static assets. The region you select determines where your optional staging environments and API function app will be located.

  6. Select the presets that match your application type.

    Application presets: No framework

    Enter /src as the location for the application files and press Enter.

    This app does not produce a build output. Ensure the build output location is empty and press Enter.

  7. Once the app is created, a confirmation notification is shown in Visual Studio Code.

    Created confirmation

    As the deployment is in progress, the Visual Studio Code extension reports the build status to you.

    Waiting for deployment

    Once the deployment is complete, you can navigate directly to your website.

  8. To view the website in the browser, right-click on the project in the Static Web Apps extension, and select Browse Site.

    Browse site

Clean up resources

If you're not going to continue to use this application, you can delete the Azure Static Web Apps instance through the extension.

In the Visual Studio Code Explorer window, return to the Static Web Apps section and right-click on my-first-static-web-app and select Delete.

A screenshot showing how to delete the app

Next steps