Microsoft Certified Azure Administrator Associate · Free Practice Question Medium
Question 1
You have an Azure subscription that contains a resource group named RG1.
You plan to create a storage account named storage1.
You have a Bicep file named File1.
You need to modify File1 so that it can be used to automate the deployment of storage1 to RG1.
Which property should you modify?
-
A
kind
-
B
scope
-
C
sku
-
D
location
Reveal correct answer
Correct answer: B
B.
To automate the deployment of the storage account named storage1 to the resource group RG1 using a Bicep file, you should modify the scope property in the Bicep file. This property should be set to the symbolic name of the resource group where you want to deploy the storage account. Here's an example of how you can set the scope property:
- targetScope = 'subscription'
- // Creating resource group
- resource RG1 'Microsoft.Resources/resourceGroups@2021-01-01' = {
- name: 'rg1-new'
- location: 'westus2'
- }
- // Deploying storage account using module
- module stg './storage.bicep' = {
- name: 'storageDeployment'
- scope: RG1 // Deployed in the scope of resource group we created above
- params: {
- storageAccountName: 'storage772229'
- }
- }
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
