0
0
Azurecloud~10 mins

Key Vault references in App Service 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 enable Key Vault references in an Azure App Service configuration.

Azure
appSettings = {
  "AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=storageaccount;AccountKey=[1];EndpointSuffix=core.windows.net"
}
Drag options to blanks, or click blank then click option'
ADefaultEndpointsProtocol=https
Bhttps://myvault.vault.azure.net/
CmyStorageAccountKey
D@Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/mysecret/)
Attempts:
3 left
💡 Hint
Common Mistakes
Using the secret name directly without the Key Vault reference syntax.
Providing only the vault URL without the secret path.
2fill in blank
medium

Complete the code to add a Key Vault reference in the App Service's application settings JSON.

Azure
{
  "properties": {
    "appSettings": [
      {
        "name": "MySecret",
        "value": "[1]"
      }
    ]
  }
}
Drag options to blanks, or click blank then click option'
Ahttps://vaultname.vault.azure.net/
BmySecretValue
Csecretname
D@Microsoft.KeyVault(SecretUri=https://vaultname.vault.azure.net/secrets/secretname/)
Attempts:
3 left
💡 Hint
Common Mistakes
Using only the secret name or vault URL without the full URI.
Omitting the '@Microsoft.KeyVault' prefix.
3fill in blank
hard

Fix the error in the Key Vault reference syntax in the app setting value.

Azure
"MySecret": "[1]"
Drag options to blanks, or click blank then click option'
A@Microsoft.KeyVault(SecretUri=https://vault.vault.azure.net/secrets/secret/)
B@Microsoft.KeyVaultSecretUri=https://vault.vault.azure.net/secrets/secret/
Chttps://vault.vault.azure.net/secrets/secret/
D@Microsoft.KeyVault(Secret=https://vault.vault.azure.net/secrets/secret/)
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Secret' instead of 'SecretUri'.
Missing parentheses around the URI.
Using '=' outside the parentheses.
4fill in blank
hard

Fill both blanks to correctly configure an App Service setting with a Key Vault reference and enable system-assigned managed identity.

Azure
{
  "identity": {
    "type": "[1]"
  },
  "siteConfig": {
    "appSettings": [
      {
        "name": "MySecret",
        "value": "[2]"
      }
    ]
  }
}
Drag options to blanks, or click blank then click option'
ASystemAssigned
BUserAssigned
C@Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/mysecret/)
Dhttps://myvault.vault.azure.net/secrets/mysecret/
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'UserAssigned' instead of 'SystemAssigned' when system identity is needed.
Providing only the vault URL without the secret URI in the app setting.
5fill in blank
hard

Fill all three blanks to configure an App Service with a user-assigned managed identity and a Key Vault reference in app settings.

Azure
{
  "identity": {
    "type": "[1]",
    "userAssignedIdentities": {
      "[2]": {}
    }
  },
  "siteConfig": {
    "appSettings": [
      {
        "name": "DatabasePassword",
        "value": "[3]"
      }
    ]
  }
}
Drag options to blanks, or click blank then click option'
AUserAssigned
B/subscriptions/1234/resourceGroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity
C@Microsoft.KeyVault(SecretUri=https://vaultname.vault.azure.net/secrets/dbpassword/)
DSystemAssigned
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'SystemAssigned' type when user-assigned identity is required.
Providing only the identity name instead of full resource ID.
Omitting '@Microsoft.KeyVault' syntax in app settings.