0
0
Azurecloud~10 mins

Environment variables and configuration in Azure - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set an environment variable in an Azure App Service.

Azure
az webapp config appsettings set --name myApp --resource-group myResourceGroup --settings [1]=production
Drag options to blanks, or click blank then click option'
AAPP_ENV
BENV_MODE
CCONFIG
DSETTINGS
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic names like SETTINGS which do not specify environment
Using variable names that are not recognized by the app
2fill in blank
medium

Complete the code to retrieve an environment variable in an Azure Function app using Python.

Azure
import os
connection_string = os.getenv('[1]')
Drag options to blanks, or click blank then click option'
ADATABASE_URL
BAPPINSIGHTS_INSTRUMENTATIONKEY
CFUNCTIONS_WORKER_RUNTIME
DAzureWebJobsStorage
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated environment variables like DATABASE_URL
Confusing runtime variables with storage connection strings
3fill in blank
hard

Fix the error in the Azure CLI command to list environment variables for a web app.

Azure
az webapp config appsettings [1] --name myApp --resource-group myResourceGroup
Drag options to blanks, or click blank then click option'
Alist
Bshow
Cget
Ddisplay
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'show' which is not a valid subcommand here
Using 'get' or 'display' which are invalid commands
4fill in blank
hard

Fill both blanks to set two environment variables in an Azure App Service.

Azure
az webapp config appsettings set --name myApp --resource-group myResourceGroup --settings [1]=true [2]=us-east
Drag options to blanks, or click blank then click option'
AFEATURE_FLAG
BREGION
CDEBUG_MODE
DLOCATION
Attempts:
3 left
💡 Hint
Common Mistakes
Using DEBUG_MODE instead of FEATURE_FLAG for feature toggling
Using LOCATION instead of REGION which is more common in Azure
5fill in blank
hard

Fill all three blanks to create a Python dictionary from environment variables for configuration.

Azure
config = {
  'env': os.getenv('[1]'),
  'debug': os.getenv('[2]') == 'true',
  'region': os.getenv('[3]')
}
Drag options to blanks, or click blank then click option'
AAPP_ENV
BDEBUG_MODE
CREGION
DFEATURE_FLAG
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing FEATURE_FLAG with debug variable
Using wrong variable names that do not match purpose