swapp - A CLI for managing App Settings in Azure Static Web Apps
Burke Holland
Posted on June 5, 2020
“swapp” is a command line utility (CLI) for managing Application Settings in Azure Static Web Apps.
Application settings are settings that are stored in Azure and can be consumed by Static Web App API’s via the process.env
variable. This is ideal for sensitive information like database connection strings, application keys, ect. Currently, these application settings have to be managed from the Azure Portal or with a rather cryptic Azure CLI REST command. Swapp abstracts this REST command into a simple command line interface.
Swapp only does two things - upload your application settings and list your application settings.
Batch upload of app settings
Swapp assumes that you have a local.settings.json
file in the directory where you run the “swapp” command. To upload all of your application settings in one go, run npx swapp upload
from the same directory where your local.settings.json
file is. You will need to select your subscription, enter your resource group and application name. Then swapp will do it’s thing…
Listing app settings
Sometimes you just wanna know what app settings your app currently has in Azure. Perhaps you just want to check and make sure the app settings you just uploaded are actually there. To do that, run npx swapp list
. This command can be run from any directory.
For more information on app settings in Azure Static Web Apps, see this article. Also, the VS Code extension for Static Web Apps will upload your app setttings automatically as well.
Posted on June 5, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.