AZ-104 Practice Question 97: Bicep Subscription Scope

Microsoft Azure Administrator Associate (AZ-104) · Test 10 · question 7 of 10

Computeeasy

A single Bicep deployment must create a new resource group and the resources inside it. Neither exists yet.

How should the administrator deploy it?

Select one answer
Show answer and explanation

Answer:

  • B. Set targetScope to 'subscription' and deploy with az deployment sub create

A resource group is created at subscription scope. With targetScope = 'subscription', the file creates the resource group and deploys a module scoped to it, all in one deployment started with az deployment sub create.

Option A needs the resource group to exist before the deployment starts.

Option C deploys at tenant scope, which is meant for tenant-level resources and not for a resource group in one subscription.

Option D is invalid because a resource group cannot be declared directly at management group scope; it needs a subscription scope, which a management group deployment reaches only through a nested subscription-scoped deployment.

Reference: Subscription deployments with Bicep files

Practice Test 10 ›

Study guides for AZ-104