0
0
Azurecloud~10 mins

Application settings and connection strings 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 add an application setting named 'AppMode' with value 'Production' in Azure App Service.

Azure
az webapp config appsettings set --name MyApp --resource-group MyResourceGroup --settings [1]
Drag options to blanks, or click blank then click option'
AAppMode Production
BAppMode:Production
CAppMode=Production
DAppMode=>Production
Attempts:
3 left
💡 Hint
Common Mistakes
Using ':' or '>' instead of '=' between key and value.
Leaving a space between key and value.
2fill in blank
medium

Complete the code to retrieve the connection string named 'MyDb' from an Azure App Service.

Azure
az webapp config connection-string show --name MyApp --resource-group MyResourceGroup --connection-string-type SQLAzure --query [1]
Drag options to blanks, or click blank then click option'
AconnectionStrings['MyDb'].value
BconnectionStrings['MyDb']
CconnectionStrings.MyDb
DconnectionStrings.MyDb.value
Attempts:
3 left
💡 Hint
Common Mistakes
Using dot notation without quotes for keys with special characters.
Not accessing the 'value' property.
3fill in blank
hard

Fix the error in the code to update a connection string named 'StorageAccount' with a new value.

Azure
az webapp config connection-string set --name MyApp --resource-group MyResourceGroup --settings StorageAccount=[1] --connection-string-type Custom
Drag options to blanks, or click blank then click option'
A"DefaultEndpointsProtocol=https;AccountName=storage;AccountKey=key;EndpointSuffix=core.windows.net"
B'DefaultEndpointsProtocol=https;AccountName=storage;AccountKey=key;EndpointSuffix=core.windows.net'
CDefaultEndpointsProtocol=https;AccountName=storage;AccountKey=key;EndpointSuffix=core.windows.net
DDefaultEndpointsProtocol=https,AccountName=storage,AccountKey=key,EndpointSuffix=core.windows.net
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting the connection string value.
Using commas instead of semicolons.
4fill in blank
hard

Fill both blanks to create a new app setting 'Environment' with value 'Staging' and a connection string 'DbConn' with type 'SQLServer'.

Azure
az webapp config appsettings set --name MyApp --resource-group MyResourceGroup --settings [1] && az webapp config connection-string set --name MyApp --resource-group MyResourceGroup --settings [2] --connection-string-type [3]
Drag options to blanks, or click blank then click option'
AEnvironment=Staging
BDbConn=Server=tcp:myserver.database.windows.net;Database=mydb;User Id=user;Password=pass;
CSQLServer
DEnvironment:Staging
Attempts:
3 left
💡 Hint
Common Mistakes
Using ':' instead of '=' in app settings.
Wrong connection-string-type value.
5fill in blank
hard

Fill all three blanks to list all app settings, filter for keys starting with 'APP_', and output only their values.

Azure
az webapp config appsettings list --name MyApp --resource-group MyResourceGroup | jq '[.[] | select(.name | startswith([1])) | [2]]' | jq -r '.[] | [3]'
Drag options to blanks, or click blank then click option'
A"\"APP_\""
B.value
D.name
Attempts:
3 left
💡 Hint
Common Mistakes
Not escaping quotes in the string for startswith.
Using '.name' instead of '.value' to output values.