QuestionQ157

VerifiedDeploy and manage Azure compute resources

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 change?

Explanation

In Bicep, a module's scope property sets where that nested deployment is targeted (a resource group, subscription, management group, or tenant). The file itself is scoped by targetScope, which defaults to 'resourceGroup', and resources that you declare directly with the resource keyword are deployed at the same scope as the deployment. When RG1 isn't the resource group that the deployment targets (for example, when the file is deployed at subscription scope), declare storage1 in a module and set the module's scope property, for example scope: resourceGroup('RG1'). The other properties—kind, sku, and location—configure the storage account itself, not the deployment target.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!