0
0
Azurecloud~10 mins

Bicep syntax and modules 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 declare a string parameter named 'location'.

Azure
param location [1]
Drag options to blanks, or click blank then click option'
Astring
Bint
Cbool
Dobject
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong type like int or bool for a text parameter.
Forgetting to specify the type after the parameter name.
2fill in blank
medium

Complete the code to create a resource of type 'Microsoft.Storage/storageAccounts' with the name 'storageAccount1'.

Azure
resource storageAccount1 '[1]' = {
  name: 'storageaccount1'
  location: 'eastus'
  kind: 'StorageV2'
  sku: {
    name: 'Standard_LRS'
  }
}
Drag options to blanks, or click blank then click option'
AMicrosoft.Compute/virtualMachines@2021-04-01
BMicrosoft.Network/virtualNetworks@2021-02-01
CMicrosoft.Storage/storageAccounts@2021-04-01
DMicrosoft.Web/sites@2021-01-15
Attempts:
3 left
💡 Hint
Common Mistakes
Using a resource type for a different service like virtual machines.
Omitting the API version after the '@' symbol.
3fill in blank
hard

Fix the error in the module declaration by completing the missing keyword.

Azure
module myModule '[1]' = {
  name: 'exampleModule'
  params: {
    location: 'westus'
  }
}
Drag options to blanks, or click blank then click option'
Adeploy.bicep
Bmodule.bicep
Cstorage.bicep
Dmain.bicep
Attempts:
3 left
💡 Hint
Common Mistakes
Using an incorrect or non-existing file name.
Forgetting to include the file extension '.bicep'.
4fill in blank
hard

Fill both blanks to define an output named 'storageAccountId' that returns the resource ID of 'storageAccount1'.

Azure
output storageAccountId [1] = storageAccount1[2]
Drag options to blanks, or click blank then click option'
Astring
B.id
C.name
Dint
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong output type like int.
Accessing the resource name instead of its ID.
5fill in blank
hard

Fill both blanks to declare a parameter 'tags' as an object with a default empty value.

Azure
param tags [1] = [2]
Drag options to blanks, or click blank then click option'
Aobject
B{}
C[]
Dstring
Attempts:
3 left
💡 Hint
Common Mistakes
Using array brackets [] instead of object braces {}.
Setting the type to string instead of object.