0
0
Azurecloud~10 mins

ARM template outputs 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 define an output named 'storageAccountName' in an ARM template.

Azure
"outputs": {
  "storageAccountName": {
    "type": "string",
    "value": [1]
  }
}
Drag options to blanks, or click blank then click option'
A"parameters('storageAccountName')"
B"resourceGroup().name"
C"[variables('storageAccountName')]"
D"deployment().name"
Attempts:
3 left
💡 Hint
Common Mistakes
Using parameters instead of variables for this output.
Referencing deployment or resource group names incorrectly.
2fill in blank
medium

Complete the code to output the resource ID of a storage account named 'myStorage'.

Azure
"outputs": {
  "storageAccountId": {
    "type": "string",
    "value": [1]
  }
}
Drag options to blanks, or click blank then click option'
A"subscription().id"
B"resourceGroup().id"
C"parameters('storageAccountName')"
D"[resourceId('Microsoft.Storage/storageAccounts', 'myStorage')]"
Attempts:
3 left
💡 Hint
Common Mistakes
Using resourceGroup or subscription IDs instead of the specific resource ID.
Referencing parameters without constructing the resource ID.
3fill in blank
hard

Fix the error in the output value that tries to return the primary connection string of a storage account resource.

Azure
"outputs": {
  "connectionString": {
    "type": "string",
    "value": [1]
  }
}
Drag options to blanks, or click blank then click option'
A"[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2021-04-01').keys[0].value]"
B"listKeys('Microsoft.Storage/storageAccounts', variables('storageAccountName'), '2021-04-01').keys[0].value"
C"listKeys(resourceGroup().name, variables('storageAccountName'), '2021-04-01').keys[0].value"
D"listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName')), '2021-04-01').keys[1].value"
Attempts:
3 left
💡 Hint
Common Mistakes
Passing resource type and name separately instead of a full resource ID.
Using incorrect index for keys array.
Using parameters instead of variables inconsistently.
4fill in blank
hard

Fill both blanks to output the public IP address of a resource named 'myPublicIP'.

Azure
"outputs": {
  "publicIPAddress": {
    "type": "string",
    "value": "[[1]('Microsoft.Network/publicIPAddresses', [2]).ipAddress]"
  }
}
Drag options to blanks, or click blank then click option'
Areference
B'myPublicIP'
Cvariables('publicIPName')
DresourceId
Attempts:
3 left
💡 Hint
Common Mistakes
Using resourceId instead of reference for output value.
Hardcoding the resource name instead of using variables.
5fill in blank
hard

Fill all three blanks to output a dictionary with the storage account name, resource group, and location.

Azure
"outputs": {
  "storageInfo": {
    "type": "object",
    "value": {
      "name": [1],
      "resourceGroup": [2],
      "location": [3]
    }
  }
}
Drag options to blanks, or click blank then click option'
A"[variables('storageAccountName')]"
B"[resourceGroup().name]"
C"[resourceGroup().location]"
D"parameters('location')"
Attempts:
3 left
💡 Hint
Common Mistakes
Using parameters for resource group info instead of resourceGroup().
Mixing up location and name values.