# Microsoft AzureAzure is a cloud platform from Microsoft. You can deploy your Thulite site with Microsoft Azure's Static Web Apps service.
Use [Azure](https://azure.microsoft.com/en-us) and its [Static Web Apps](https://azure.microsoft.com/en-us/products/app-service/static/) service to deploy your Thulite site.

{{< callout context="tip" icon="bulb" >}}
Looking for an example? Check out the [official Microsoft Azure Doks example project](https://github.com/thuliteio/doks-microsoft-azure)!
{{< /callout >}}

This guide shows how to deploy a Thulite site hosted on GitHub using Visual Studio Code. For other setups, see Microsoft's guide for the [Azure Pipelines Task](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/azure-static-web-app-v0?view=azure-pipelines).

## Prerequisites

To follow this guide, you need:

- An Azure account and subscription key. You can create a [free Azure account here](https://azure.microsoft.com/free).
- Your app code pushed to [GitHub](https://github.com/).
- The [SWA Extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurestaticwebapps) in [Visual Studio Code](https://code.visualstudio.com/).

## How to deploy

{{< steps >}}
{{< step >}}
Open your project in VS Code.
{{< /step >}}
{{< step >}}
Open the Static Web Apps extension, sign in to Azure, and click + to create a new Static Web App. You will be prompted to choose a subscription key.
{{< /step >}}
{{< step >}}
Follow the wizard to name your app, choose a framework preset, and set the app root (usually `/`) and build output location (use `/public`). Because Thulite is not in Azure's built-in templates, select `custom`. The wizard then creates a [GitHub Action](https://github.com/features/actions) in your repo's `.github` folder (created automatically if needed).

The GitHub Action deploys your app. You can track progress in your repository's Actions tab on GitHub. When it completes successfully, click Browse Website in the SWA extension progress window to open the deployed site.
{{< /step >}}
{{< /steps >}}

## Known Issues

Builds can fail if your Node or Hugo version is outdated.

### Node version

To resolve this, update your project's `package.json` with this snippet:

```json {title="package.json"}
{
  "engines": {
    "node": ">=24.13.0"
  },
}
```

### Hugo version

To resolve this, update your workflow file by providing a value for `HUGO_VERSION` in the `env` section:

```yaml {title="workflow.yml"}
jobs:
  build_and_deploy_job:
    if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed')
    runs-on: ubuntu-latest
    name: Build and Deploy Job
    steps:
      - uses: actions/checkout@v3
        with:
          submodules: true
          lfs: false
      - name: Build And Deploy
        id: builddeploy
        uses: Azure/static-web-apps-deploy@v1
        with:
          azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_NICE_BUSH_0D736421E }}
          repo_token: ${{ secrets.GITHUB_TOKEN }} # Used for Github integrations (i.e. PR comments)
          action: "upload"
          ###### Repository/Build Configurations - These values can be configured to match your app requirements. ######
          # For more information regarding Static Web App workflow configurations, please visit: https://aka.ms/swaworkflowconfig
          app_location: "/" # App source code path
          api_location: "api" # Api source code path - optional
          output_location: "public" # Built app content directory - optional
          ###### End of Repository/Build Configurations ######
        env:
          HUGO_VERSION: 0.161.1

```

## Resources

- [Deploy a Hugo site to Azure Static Web Apps](https://learn.microsoft.com/en-us/azure/static-web-apps/publish-hugo)
- [Custom Hugo version](https://learn.microsoft.com/en-us/azure/static-web-apps/publish-hugo#custom-hugo-version)
- [Microsoft Azure Static Web Apps documentation](https://learn.microsoft.com/en-us/azure/static-web-apps/)
