Skip to main content

Environment Variables

General Settings

Environment VariablePurposeRead Only?Default Value
SWA_CLI_VERSIONCLI versionYes
SWA_CLI_DEBUGEnable verbose logs (silly, silent, log, info or error)log
DEBUGGeneral purpose environment variable used to enable verbose logs for common tools

Emulator Settings

Environment VariablePurposeRead Only?Default Value
SWA_CLI_API_LOCATIONFolder containing the source code of the API application./api
SWA_CLI_APP_LOCATIONFolder containing the source code of the front-end application./
SWA_CLI_OUTPUT_LOCATIONFolder containing the front-end public files./
SWA_CLI_HOSTHost address to use for the CLI dev serverlocalhost
SWA_CLI_PORTHost port to use for the CLI dev server4280
SWA_CLI_API_PORTAPI server port to use7071
SWA_CLI_APP_SSLUse HTTPS to serve the front-end application and API (true or false)false
SWA_CLI_APP_SSL_KEYSSL key (.key) to use when enabling HTTPS
SWA_CLI_APP_SSL_CERTSSL certificate (.crt) to use when enabling HTTPS
SWA_CLI_STARTUP_COMMANDRun a custom shell command or script file at startup
SWA_CLI_OPEN_BROWSERAutomatically open the CLI dev server in the default browser (true or false)false
SWA_CLI_SERVER_TIMEOUTThe time to wait (in seconds) when connecting to a front-end application's dev server or api server60
SWA_CLI_APP_DEVSERVER_URLConnect to the dev server at this URL instead of using output location
SWA_CLI_API_DEVSERVER_URLConnect to the api server at this URL instead of using output location

Deploy settings

Environment VariablePurposeRead Only?Default Value
SWA_CLI_APP_NAMEProject name
SWA_CLI_DEPLOYMENT_TOKENSecret token used to authenticate with the Static Web Apps
SWA_CLI_DEPLOY_DRY_RUNSimulate a deploy process without actually running it (true or false)false
SWA_CLI_DEPLOY_BINARY_VERSIONDeployment binary version to usestable
SWA_CLI_DEPLOY_BINARYAbsoluate path to the deploy binaryYes
SWA_CLI_DEPLOY_ENVthe type of deployment environment where to deploy the projectpreview
AZURE_REGION_LOCATIONAzure region where to deploy the project. Available regions are: westus2,centralus,eastus2,westeurope,eastasiawestus2
AZURE_RESOURCE_GROUPAzure resource group
AZURE_SUBSCRIPTION_IDAzure subscription ID
SWA_CLI_API_LANGUAGERuntime Language of the functionnode
SWA_CLI_API_VERSIONVersion of the function runtime language16

Runtime settings

Environment VariablePurposeRead Only?Default Value
SWA_RUNTIME_CONFIGAbsolute path to staticwebapp.config.json
SWA_RUNTIME_CONFIG_LOCATIONFolder containing the file staticwebapp.config.json
SWA_RUNTIME_WORKFLOW_LOCATIONAbsolute path to .github/workflows/azure-static-web-apps-xyz.ymlYes

Azure Identity

Environment VariablePurposeRead Only?Default Value
SWA_CLI_LOGIN_USE_KEYCHAINEnable using the operating system native keychain for persistent credentials (true or false)true
SWA_CLI_LOGIN_CLEAR_CREDENTIALSClear clear persisted credentials before login (true or false)false
AZURE_CLIENT_IDAzure Active Directory client ID
AZURE_CLIENT_SECRETAzure Active Directory secret
AZURE_TENANT_IDAzure Active Directory tenant ID