DEV Community

Cover image for swapp - A CLI for managing App Settings in Azure Static Web Apps
Burke Holland for Microsoft Azure

Posted on • Originally published at on

swapp - A CLI for managing App Settings in Azure Static Web Apps

“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.

Top comments (2)

jornh profile image
jornh • Edited

FYI: Videos above here on (on an iPad) gives me a:

If the owner of this video has granted you access, please sign in.

Luckily they work on your original site

edit: I see it’s updated and working now, great thanks!

burkeholland profile image
Burke Holland

Yep - sorry about that! Apparently I'm still learning how to "YouTube".