Published: August 2025

API configuration

To use the API, the code of the API has to be provided and the configuration of the Static Web App has to be modified.

Static Web App configuration

In the staticwebapp.config.json configuration file (in the root of the website) should specify the platform the API must be running on:

{
  "platform": {
    "apiRuntime": "dotnet-isolated:8.0"
  }
}

See the list of the available runtimes; for the API only the isolated .NET platforms seem to be available.

Code deployment

The code should be provided as a C#/.NET project based on the Azure Functions template as provided in Visual Studio. The project should be part of the same git repository (branch) as the content of the website.

The publication tool requires as extra argument the location of the source code. E.g., for an Azure pipeline:


  - task: AzureStaticWebApp@0
    inputs:
      app_location: 'wwwroot' # App source code path relative to the root of the repository
      api_location: 'api' # The location of the API source code
      azure_static_web_apps_api_token: $(deployment_token)
      deployment_environment: Test # Name of the environment to create.

The tool will find the .csproj in the source code location and compile that.