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