Skip to main content

Azure Static Web App–API configuration

As a follow-up on the presentation I did at CloudBrew about Azure Static Web Apps I want to write a series of blog posts.

In the last post in this series, I talked about the application configuration. But an Azure Static Web App can be a combination of an application part and an API part. Today we’ll have a look on how to configure the API part.

Storing values

API configuration settings can be set through the Azure Portal or Azure CLI and are stored in the backend of your Azure Static Web App in an encrypted format.

Azure Portal

To set a configuration value through the Azure Portal, go to Configuration:


Select the environment for which you want to specify configuration values and click on Add:

Enter a name and a value and click on OK:

Click on Save to apply the settings.

Azure CLI

If you prefer to use the Azure CLI, you can use the az staticwebapp appsettings command:

az staticwebapp appsettings set --name <YOUR_APP_ID> --setting-names "message=Hello world"

Using the stored values

The values stored are available as environment variables inside your Azure Function:

More information

Configure application settings for Azure Static Web Apps | Microsoft Learn