Skip to content

Latest commit

 

History

History
35 lines (28 loc) · 1.16 KB

File metadata and controls

35 lines (28 loc) · 1.16 KB
ms.topic include
ms.date 07/27/2022

To set environment variables in App Service, you create app settings with the following az webapp config appsettings set command.

az webapp config appsettings set \
   --resource-group $RESOURCE_GROUP_NAME \
   --name $APP_SERVICE_NAME \
   --settings CONNECTION_STRING=$CONNECTION_STRING \
              DB_NAME=$DB_NAME  \
              COLLECTION_NAME=$COLLECTION_NAME 
az webapp config appsettings set `
   --resource-group $RESOURCE_GROUP_NAME `
   --name $APP_SERVICE_NAME `
   --settings CONNECTION_STRING=$CONNECTION_STRING `
              DB_NAME=$DB_NAME  `
              COLLECTION_NAME=$COLLECTION_NAME 

  • CONNECTION_STRING → A connection string that starts with "mongodb://".
  • DB_NAME → Use "restaurants_reviews".
  • COLLECTION_NAME → Use "restaurants_reviews".
  • WEBSITES_PORT → Use "8000" for Django and "5000" for Flask. This environment variable specifies the port on which the container is listening.