0
0
Azurecloud~10 mins

ARM template parameters and variables 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 a parameter named 'location' in an ARM template.

Azure
"parameters": {
  "location": {
    "type": "[1]"
  }
}
Drag options to blanks, or click blank then click option'
Aint
Bbool
Cstring
Darray
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'int' or 'bool' for a text parameter causes errors.
Forgetting to specify the type.
2fill in blank
medium

Complete the code to define a variable named 'storageAccountName' that concatenates 'storage' and a unique string.

Azure
"variables": {
  "storageAccountName": "concat('storage', [1])"
}
Drag options to blanks, or click blank then click option'
Aparameters('location')
BuniqueString(resourceGroup().id)
CresourceGroup().name
Dsubscription().id
Attempts:
3 left
💡 Hint
Common Mistakes
Using parameters or subscription ID directly without uniqueness.
Using resourceGroup().name which may not be unique.
3fill in blank
hard

Fix the error in the variable definition that tries to get the first element of a parameter array named 'vmSizes'.

Azure
"variables": {
  "firstVmSize": "[1](parameters('vmSizes'), 0)"
}
Drag options to blanks, or click blank then click option'
Aindex
Bfirst
Cparameters
Dparameters('vmSizes')[0]
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'first' which is not a valid ARM function.
Trying to use array indexing syntax directly.
4fill in blank
hard

Fill both blanks to define a parameter 'adminUsername' with a default value and a variable 'adminUser' that references it.

Azure
"parameters": {
  "adminUsername": {
    "type": "[1]",
    "defaultValue": "azureuser"
  }
},
"variables": {
  "adminUser": "[2]('adminUsername')"
}
Drag options to blanks, or click blank then click option'
Astring
Bint
Cparameters
Dvariables
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'int' as parameter type for a username.
Using 'variables' function to reference parameters.
5fill in blank
hard

Fill all three blanks to define a variable 'fullName' that combines 'firstName' and 'lastName' parameters with a space.

Azure
"variables": {
  "fullName": "concat([1]('firstName'), [2], [3]('lastName'))"
}
Drag options to blanks, or click blank then click option'
Aparameters
B' '
Dvariables
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'variables' function instead of 'parameters'.
Forgetting to add space between names.