Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Deploy containers to Azure App Service, including configuring App Service to supply environment variables and secrets

A worked example

Yes or no

You deploy a .NET application as a Linux custom container to an Azure App Service web app named app-docprocessor.

You run the command in the exhibit to add a connection string. You also add an app setting named LOG_LEVEL with the value INFO. This value contains no sensitive data.

The application also reads a nested .NET configuration key named Logging:LogLevel:Default. You want to supply this key through App Service configuration.

az webapp config connection-string set \
    --resource-group rg-docs \
    --name app-docprocessor \
    --connection-string-type SQLAzure \
    --settings DefaultConnection="Server=sqlsrv-docs.database.windows.net;Database=docsdb"

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

StatementYesNo
The container can read the connection string from an environment variable named SQLAZURECONNSTR_DefaultConnection.

App Service puts a type prefix on connection string environment variables. For the SQL Azure type the prefix is SQLAZURECONNSTR_, so DefaultConnection becomes SQLAZURECONNSTR_DefaultConnection.

Correct
App Service stores the LOG_LEVEL app setting unencrypted because its value contains no sensitive data.

App Service encrypts all app settings at rest, whether or not they contain sensitive data. It decrypts them only when it injects them into the container.

Correct
To supply the key Logging:LogLevel:Default, you should create an app setting named Logging__LogLevel__Default.

For nested .NET configuration in Linux containers, replace each colon with two underscores. The resulting setting name is Logging__LogLevel__Default.

Correct
Why

App Service injects app settings and connection strings into the container as environment variables. A connection string gets a prefix that matches its type, so a SQLAzure connection string named DefaultConnection appears as SQLAZURECONNSTR_DefaultConnection. App Service encrypts every app setting at rest, so the sensitivity of LOG_LEVEL makes no difference. On Linux, a nested .NET key such as Logging:LogLevel:Default must use double underscores in place of the colons.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free