English original · Source of truth for the Chinese translation. Verified against current Microsoft Learn documentation.

Deployment Scopes and Orchestration

Choose resource-group, subscription, management-group or tenant scope and coordinate cross-scope deployments with explicit ownership and least privilege.
BicepAzure Resource ManagerAzure CLIEnglish original · Source of truth for the Chinese translation. Verified against current Microsoft Learn documentation.
Learning outcomes / 学习目标
  • targetScope and deployment functions — deliver a reviewed, validated change at the right scope
  • Resource-group scope and existing groups — deliver a reviewed, validated change at the right scope
  • Subscription-level resource patterns — deliver a reviewed, validated change at the right scope
  • Management-group and tenant deployments — deliver a reviewed, validated change at the right scope
  • Cross-scope module orchestration — deliver a reviewed, validated change at the right scope
  • Deployment names, location and history — deliver a reviewed, validated change at the right scope
  • Platform baseline orchestration lab — deliver a reviewed, validated change at the right scope
  • Scope and role review — deliver a reviewed, validated change at the right scope
Deployments change Azure resources. Write only to an authorized sandbox; confirm tenant, subscription, scope, what-if, permissions and recovery plan first.

Schedule / 课程安排

#ModuleMinutes
1targetScope and deployment functions7
2Resource-group scope and existing groups7
3Subscription-level resource patterns7
4Management-group and tenant deployments7
5Cross-scope module orchestration7
6Deployment names, location and history7
7Platform baseline orchestration lab7
8Scope and role review7

Start / 开始 → · Official references / 官方文档

Warm-up and Azure setup / 课前准备与 Azure 设置

Install Azure CLI, Bicep CLI and the VS Code Bicep extension. Use a sandbox subscription and confirm tenant, subscription, role and budget.

az version
az bicep version
az account show
az bicep build --file main.bicep
az bicep lint --file main.bicep
Do not run create/update before reviewing what-if, identity, target scope and recovery plan.

targetScope and deployment functions

Hour 5 · Module 1 · 7 min
BicepAzure Resource ManagerEnglish original · Source of truth for the Chinese translation. Verified against current Microsoft Learn documentation.

Core model

Choose resource-group, subscription, management-group or tenant scope and coordinate cross-scope deployments with explicit ownership and least privilege.

This module uses targetScope and deployment functions to connect language syntax, ARM evaluation, provider behavior and team ownership. Before writing declarations, identify target scope, resource owner, input source, dependency edges, observable evidence and recovery action.

Key principle: Bicep compiles to ARM JSON and Azure Resource Manager orchestrates resource state. Repeatability is not a safety guarantee; API versions, mutability, external dependencies and authorization still require independent review.

Worked Bicep example

targetScope = 'subscription'

param location string
param workloadRg string

resource rg 'Microsoft.Resources/resourceGroups@2024-03-01' = {
  name: workloadRg
  location: location
}

module workload './workload.bicep' = {
  name: 'workload'
  scope: rg
  params: { location: location }
}

Trace targetScope, parameter provenance, symbolic references, implicit dependencies and output contract. Validate names, API versions and properties against the target environment and current provider schema.

Design review / 设计评审

Review questions: Who owns targetScope and deployment functions? Can callers infer defaults? Are inputs constrained by types? What happens on redeploy, manual drift, concurrent change or retry? Could an immutable property replace production data? How can deployment evidence be retained without exposing secrets?

Self-paced practice: choose one or two clinics; the hour schedule is not intended to complete every prompt.

Architecture clinic 1

Scenario: An environment promotion must compare source and target configuration. In this targetScope and deployment functions drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 2

Scenario: A team wants to test snapshots without querying live Azure. In this targetScope and deployment functions drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 3

Scenario: A production resource has immutable properties that cannot be replaced. In this targetScope and deployment functions drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 4

Scenario: A module uses experimental features without an upgrade owner. In this targetScope and deployment functions drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 5

Scenario: A cost review asks which resources a template owns. In this targetScope and deployment functions drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 6

Scenario: A team needs an audited emergency deployment path. In this targetScope and deployment functions drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 7

Scenario: A public module dependency changes upstream behavior. In this targetScope and deployment functions drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 8

Scenario: A resource group is created separately from its workload resources. In this targetScope and deployment functions drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 9

Scenario: A cleanup request could remove shared networking by mistake. In this targetScope and deployment functions drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 10

Scenario: A template has hard-coded environment names in several modules. In this targetScope and deployment functions drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 11

Scenario: A service team needs to roll back an API-version update. In this targetScope and deployment functions drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 12

Scenario: A deployment has a dependency cycle across modules. In this targetScope and deployment functions drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 13

Scenario: A template should adopt secure defaults without blocking exceptions. In this targetScope and deployment functions drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 14

Scenario: An engineer needs to explain deployment history and correlation IDs. In this targetScope and deployment functions drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 15

Scenario: A team is splitting a monolithic template into ownership domains. In this targetScope and deployment functions drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 16

Scenario: A release must support both cloud-hosted and private agents. In this targetScope and deployment functions drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 17

Scenario: An environment has drift that must be reconciled before deployment. In this targetScope and deployment functions drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 18

Scenario: A parameter-file change could expose secrets in source control. In this targetScope and deployment functions drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 19

Scenario: A policy assignment blocks an otherwise valid deployment. In this targetScope and deployment functions drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 20

Scenario: A stack deletion plan might detach or remove production assets. In this targetScope and deployment functions drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 21

Scenario: A product team is moving a manually configured web workload into version control. In this targetScope and deployment functions drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 22

Scenario: A regulated payment service needs a separate production boundary. In this targetScope and deployment functions drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 23

Scenario: A platform team is publishing shared modules for dozens of teams. In this targetScope and deployment functions drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 24

Scenario: An acquisition introduces existing subscriptions and naming rules. In this targetScope and deployment functions drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 25

Scenario: A deployment must preserve an existing database and its data. In this targetScope and deployment functions drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 26

Scenario: A pipeline currently uses a long-lived service-principal secret. In this targetScope and deployment functions drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 27

Scenario: A regional rollout needs consistent network and policy baselines. In this targetScope and deployment functions drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 28

Scenario: A deployment preview shows unexpected resource replacement. In this targetScope and deployment functions drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 29

Scenario: A team needs per-environment values without copying templates. In this targetScope and deployment functions drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 30

Scenario: A resource provider API version changes its required property shape. In this targetScope and deployment functions drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 31

Scenario: An auditor needs reproducible evidence for each infrastructure change. In this targetScope and deployment functions drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 32

Scenario: A shared module has breaking changes planned for a new release. In this targetScope and deployment functions drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 33

Scenario: A policy denies public endpoints but a legacy system depends on one. In this targetScope and deployment functions drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 34

Scenario: A team needs separate owners for subscription and workload resources. In this targetScope and deployment functions drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 35

Scenario: A failed pipeline leaves a partially completed deployment. In this targetScope and deployment functions drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 36

Scenario: A development environment must be safely torn down every sprint. In this targetScope and deployment functions drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 37

Scenario: A production change must pass review before any write operation. In this targetScope and deployment functions drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 38

Scenario: A nested module unexpectedly deploys to the wrong scope. In this targetScope and deployment functions drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 39

Scenario: A template contains a secret copied from a local parameter file. In this targetScope and deployment functions drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 40

Scenario: A release introduces a naming collision in one environment. In this targetScope and deployment functions drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 41

Scenario: A central team wants to enforce diagnostic settings consistently. In this targetScope and deployment functions drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 42

Scenario: A deployment stack may delete resources removed from its template. In this targetScope and deployment functions drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 43

Scenario: A module registry artifact is missing or inaccessible in CI. In this targetScope and deployment functions drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 44

Scenario: A resource is changed manually after a successful deployment. In this targetScope and deployment functions drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 45

Scenario: A what-if report contains many no-change and unsupported lines. In this targetScope and deployment functions drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 46

Scenario: A pipeline needs to deploy to multiple subscriptions with OIDC. In this targetScope and deployment functions drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 47

Scenario: A team is migrating a large ARM JSON template incrementally. In this targetScope and deployment functions drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 48

Scenario: A compliance team needs a time-bounded exception process. In this targetScope and deployment functions drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Deployment and ownership diagram

Git change → Bicep build / lint → validation → what-if review → scoped identity → ARM deployment → resource provider → activity/deployment evidence

Mark credential boundaries, approval ownership, correlation IDs and safe stop points at each transition.

Change sequence

1. Record desired state and affected owners

2. Build/lint locally and review the diff

3. Run validate and what-if at target scope

4. Approve and deploy in stages

5. Check resources, activity log and workload health

6. Retain evidence and rollback decision

Read-only and local commands

az bicep version
az bicep build --file main.bicep
az bicep lint --file main.bicep
az deployment group validate --resource-group <rg> --template-file main.bicep
az deployment group what-if --resource-group <rg> --template-file main.bicep
az deployment group show --resource-group <rg> --name <deployment-name>

Run az account show first to confirm tenant, subscription and principal. Validate and what-if can perform preflight checks and require read access; create/update commands submit writes. Production deployment requires reviewed authorization and change plan.

Guided lab / 指导实验

Goal: deliver an auditable Bicep change for targetScope and deployment functions. (1) Use a sandbox subscription/resource group and confirm caller identity. (2) Copy the sample into a Git branch. (3) express environment differences in parameter files rather than template copies. (4) build, lint and validate. (5) retain what-if output and explain Create/Modify/Delete/NoChange/Ignore line by line. (6) deploy only in the approved lab scope. (7) verify with Azure queries and workload probes. (8) if preview and outcome diverge, stop and retain deployment operations, correlation ID and activity log. Deliver Bicep, sample parameters, preview, verification evidence and rollback note.

Acceptance rubric / 验收标准

Pass only when the template builds, lint findings are dispositioned, parameter and identity boundaries are explicit, what-if has no unexplained destructive change, and deployment output is independently verified.

Production readiness / 生产就绪评审

Scenario: A management group deployment needs carefully scoped assignments. Review the production rollout for targetScope and deployment functions. Submit maintenance window, blast radius, change owner, approver, concurrency policy, quota checks, diagnostics/alerts, rollback trigger, data recovery and business communication. Identify template-owned resources versus existing/external dependencies, consequences of delete or detach, and stop gates for API/module upgrade failure.

Failure-mode rehearsal / 故障演练

Run a tabletop for a denied role assignment, provider validation error, partial deployment, unexpected replacement, throttling and a broken health probe. Assign who stops rollout, who gathers evidence, who restores the last known-good declaration and who communicates status.

Evidence-first troubleshooting / 证据优先排错

For a targetScope and deployment functions failure, pause retries and automatic promotion. Record commit, CLI/Bicep versions, tenant/subscription/resource group, deployment name and time. Inspect deployment operations, error code, target resource, correlation ID and Activity Log; classify as compiler/type, ARM preflight, RBAC/policy, provider/quota, dependency/runtime or pipeline artifact issue. Preserve raw responses; never use broad permissions, disabled policy or Complete mode as a generic fix.

Knowledge check / 知识检查

Question 1: targetScope and deployment functions — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 2: targetScope and deployment functions — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 3: targetScope and deployment functions — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 4: targetScope and deployment functions — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 5: targetScope and deployment functions — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Instructor narration / 讲师讲解提纲

Explain the business value of targetScope and deployment functions in five minutes. Ask learners to identify state ownership, then draw inputs, resource graph, authorization path and verification evidence. Have a peer act as change approver and challenge destructive differences, secret handling and rollback ownership. Each learner closes with one verified fact, one assumption and one sandbox-safe validation.

Next →

Resource-group scope and existing groups

Hour 5 · Module 2 · 7 min
BicepAzure Resource ManagerEnglish original · Source of truth for the Chinese translation. Verified against current Microsoft Learn documentation.

Core model

Choose resource-group, subscription, management-group or tenant scope and coordinate cross-scope deployments with explicit ownership and least privilege.

This module uses Resource-group scope and existing groups to connect language syntax, ARM evaluation, provider behavior and team ownership. Before writing declarations, identify target scope, resource owner, input source, dependency edges, observable evidence and recovery action.

Key principle: Bicep compiles to ARM JSON and Azure Resource Manager orchestrates resource state. Repeatability is not a safety guarantee; API versions, mutability, external dependencies and authorization still require independent review.

Worked Bicep example

param keyVaultName string

resource vault 'Microsoft.KeyVault/vaults@2023-07-01' existing = {
  name: keyVaultName
}

@secure()
param bootstrapSecret string

output vaultResourceId string = vault.id

Trace targetScope, parameter provenance, symbolic references, implicit dependencies and output contract. Validate names, API versions and properties against the target environment and current provider schema.

Design review / 设计评审

Review questions: Who owns Resource-group scope and existing groups? Can callers infer defaults? Are inputs constrained by types? What happens on redeploy, manual drift, concurrent change or retry? Could an immutable property replace production data? How can deployment evidence be retained without exposing secrets?

Self-paced practice: choose one or two clinics; the hour schedule is not intended to complete every prompt.

Architecture clinic 1

Scenario: A team needs an audited emergency deployment path. In this Resource-group scope and existing groups drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 2

Scenario: A public module dependency changes upstream behavior. In this Resource-group scope and existing groups drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 3

Scenario: A resource group is created separately from its workload resources. In this Resource-group scope and existing groups drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 4

Scenario: A cleanup request could remove shared networking by mistake. In this Resource-group scope and existing groups drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 5

Scenario: A template has hard-coded environment names in several modules. In this Resource-group scope and existing groups drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 6

Scenario: A service team needs to roll back an API-version update. In this Resource-group scope and existing groups drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 7

Scenario: A deployment has a dependency cycle across modules. In this Resource-group scope and existing groups drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 8

Scenario: A template should adopt secure defaults without blocking exceptions. In this Resource-group scope and existing groups drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 9

Scenario: An engineer needs to explain deployment history and correlation IDs. In this Resource-group scope and existing groups drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 10

Scenario: A team is splitting a monolithic template into ownership domains. In this Resource-group scope and existing groups drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 11

Scenario: A release must support both cloud-hosted and private agents. In this Resource-group scope and existing groups drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 12

Scenario: An environment has drift that must be reconciled before deployment. In this Resource-group scope and existing groups drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 13

Scenario: A parameter-file change could expose secrets in source control. In this Resource-group scope and existing groups drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 14

Scenario: A policy assignment blocks an otherwise valid deployment. In this Resource-group scope and existing groups drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 15

Scenario: A stack deletion plan might detach or remove production assets. In this Resource-group scope and existing groups drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 16

Scenario: A product team is moving a manually configured web workload into version control. In this Resource-group scope and existing groups drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 17

Scenario: A regulated payment service needs a separate production boundary. In this Resource-group scope and existing groups drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 18

Scenario: A platform team is publishing shared modules for dozens of teams. In this Resource-group scope and existing groups drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 19

Scenario: An acquisition introduces existing subscriptions and naming rules. In this Resource-group scope and existing groups drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 20

Scenario: A deployment must preserve an existing database and its data. In this Resource-group scope and existing groups drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 21

Scenario: A pipeline currently uses a long-lived service-principal secret. In this Resource-group scope and existing groups drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 22

Scenario: A regional rollout needs consistent network and policy baselines. In this Resource-group scope and existing groups drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 23

Scenario: A deployment preview shows unexpected resource replacement. In this Resource-group scope and existing groups drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 24

Scenario: A team needs per-environment values without copying templates. In this Resource-group scope and existing groups drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 25

Scenario: A resource provider API version changes its required property shape. In this Resource-group scope and existing groups drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 26

Scenario: An auditor needs reproducible evidence for each infrastructure change. In this Resource-group scope and existing groups drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 27

Scenario: A shared module has breaking changes planned for a new release. In this Resource-group scope and existing groups drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 28

Scenario: A policy denies public endpoints but a legacy system depends on one. In this Resource-group scope and existing groups drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 29

Scenario: A team needs separate owners for subscription and workload resources. In this Resource-group scope and existing groups drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 30

Scenario: A failed pipeline leaves a partially completed deployment. In this Resource-group scope and existing groups drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 31

Scenario: A development environment must be safely torn down every sprint. In this Resource-group scope and existing groups drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 32

Scenario: A production change must pass review before any write operation. In this Resource-group scope and existing groups drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 33

Scenario: A nested module unexpectedly deploys to the wrong scope. In this Resource-group scope and existing groups drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 34

Scenario: A template contains a secret copied from a local parameter file. In this Resource-group scope and existing groups drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 35

Scenario: A release introduces a naming collision in one environment. In this Resource-group scope and existing groups drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 36

Scenario: A central team wants to enforce diagnostic settings consistently. In this Resource-group scope and existing groups drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 37

Scenario: A deployment stack may delete resources removed from its template. In this Resource-group scope and existing groups drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 38

Scenario: A module registry artifact is missing or inaccessible in CI. In this Resource-group scope and existing groups drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 39

Scenario: A resource is changed manually after a successful deployment. In this Resource-group scope and existing groups drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 40

Scenario: A what-if report contains many no-change and unsupported lines. In this Resource-group scope and existing groups drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 41

Scenario: A pipeline needs to deploy to multiple subscriptions with OIDC. In this Resource-group scope and existing groups drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 42

Scenario: A team is migrating a large ARM JSON template incrementally. In this Resource-group scope and existing groups drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 43

Scenario: A compliance team needs a time-bounded exception process. In this Resource-group scope and existing groups drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 44

Scenario: A deployment is close to subscription quota limits. In this Resource-group scope and existing groups drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 45

Scenario: A shared platform module has no clear deprecation policy. In this Resource-group scope and existing groups drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 46

Scenario: A stack uses deny settings that could block child resource changes. In this Resource-group scope and existing groups drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 47

Scenario: A resource is supported only in selected Azure regions. In this Resource-group scope and existing groups drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 48

Scenario: A team must restore a prior configuration after a faulty change. In this Resource-group scope and existing groups drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Deployment and ownership diagram

Git change → Bicep build / lint → validation → what-if review → scoped identity → ARM deployment → resource provider → activity/deployment evidence

Mark credential boundaries, approval ownership, correlation IDs and safe stop points at each transition.

Change sequence

1. Record desired state and affected owners

2. Build/lint locally and review the diff

3. Run validate and what-if at target scope

4. Approve and deploy in stages

5. Check resources, activity log and workload health

6. Retain evidence and rollback decision

Read-only and local commands

az bicep version
az bicep build --file main.bicep
az bicep lint --file main.bicep
az deployment group validate --resource-group <rg> --template-file main.bicep
az deployment group what-if --resource-group <rg> --template-file main.bicep
az deployment group show --resource-group <rg> --name <deployment-name>

Run az account show first to confirm tenant, subscription and principal. Validate and what-if can perform preflight checks and require read access; create/update commands submit writes. Production deployment requires reviewed authorization and change plan.

Guided lab / 指导实验

Goal: deliver an auditable Bicep change for Resource-group scope and existing groups. (1) Use a sandbox subscription/resource group and confirm caller identity. (2) Copy the sample into a Git branch. (3) express environment differences in parameter files rather than template copies. (4) build, lint and validate. (5) retain what-if output and explain Create/Modify/Delete/NoChange/Ignore line by line. (6) deploy only in the approved lab scope. (7) verify with Azure queries and workload probes. (8) if preview and outcome diverge, stop and retain deployment operations, correlation ID and activity log. Deliver Bicep, sample parameters, preview, verification evidence and rollback note.

Acceptance rubric / 验收标准

Pass only when the template builds, lint findings are dispositioned, parameter and identity boundaries are explicit, what-if has no unexplained destructive change, and deployment output is independently verified.

Production readiness / 生产就绪评审

Scenario: A team wants to test snapshots without querying live Azure. Review the production rollout for Resource-group scope and existing groups. Submit maintenance window, blast radius, change owner, approver, concurrency policy, quota checks, diagnostics/alerts, rollback trigger, data recovery and business communication. Identify template-owned resources versus existing/external dependencies, consequences of delete or detach, and stop gates for API/module upgrade failure.

Failure-mode rehearsal / 故障演练

Run a tabletop for a denied role assignment, provider validation error, partial deployment, unexpected replacement, throttling and a broken health probe. Assign who stops rollout, who gathers evidence, who restores the last known-good declaration and who communicates status.

Evidence-first troubleshooting / 证据优先排错

For a Resource-group scope and existing groups failure, pause retries and automatic promotion. Record commit, CLI/Bicep versions, tenant/subscription/resource group, deployment name and time. Inspect deployment operations, error code, target resource, correlation ID and Activity Log; classify as compiler/type, ARM preflight, RBAC/policy, provider/quota, dependency/runtime or pipeline artifact issue. Preserve raw responses; never use broad permissions, disabled policy or Complete mode as a generic fix.

Knowledge check / 知识检查

Question 1: Resource-group scope and existing groups — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 2: Resource-group scope and existing groups — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 3: Resource-group scope and existing groups — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 4: Resource-group scope and existing groups — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 5: Resource-group scope and existing groups — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Instructor narration / 讲师讲解提纲

Explain the business value of Resource-group scope and existing groups in five minutes. Ask learners to identify state ownership, then draw inputs, resource graph, authorization path and verification evidence. Have a peer act as change approver and challenge destructive differences, secret handling and rollback ownership. Each learner closes with one verified fact, one assumption and one sandbox-safe validation.

Next →

Subscription-level resource patterns

Hour 5 · Module 3 · 7 min
BicepAzure Resource ManagerEnglish original · Source of truth for the Chinese translation. Verified against current Microsoft Learn documentation.

Core model

Choose resource-group, subscription, management-group or tenant scope and coordinate cross-scope deployments with explicit ownership and least privilege.

This module uses Subscription-level resource patterns to connect language syntax, ARM evaluation, provider behavior and team ownership. Before writing declarations, identify target scope, resource owner, input source, dependency edges, observable evidence and recovery action.

Key principle: Bicep compiles to ARM JSON and Azure Resource Manager orchestrates resource state. Repeatability is not a safety guarantee; API versions, mutability, external dependencies and authorization still require independent review.

Worked Bicep example

targetScope = 'resourceGroup'

param location string
param environment string

resource workspace 'Microsoft.OperationalInsights/workspaces@2022-10-01' = {
  name: 'law-${environment}'
  location: location
  properties: {
    sku: {
      name: 'PerGB2018'
    }
    retentionInDays: 30
  }
}

output workspaceId string = workspace.id

Trace targetScope, parameter provenance, symbolic references, implicit dependencies and output contract. Validate names, API versions and properties against the target environment and current provider schema.

Design review / 设计评审

Review questions: Who owns Subscription-level resource patterns? Can callers infer defaults? Are inputs constrained by types? What happens on redeploy, manual drift, concurrent change or retry? Could an immutable property replace production data? How can deployment evidence be retained without exposing secrets?

Self-paced practice: choose one or two clinics; the hour schedule is not intended to complete every prompt.

Architecture clinic 1

Scenario: A service team needs to roll back an API-version update. In this Subscription-level resource patterns drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 2

Scenario: A deployment has a dependency cycle across modules. In this Subscription-level resource patterns drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 3

Scenario: A template should adopt secure defaults without blocking exceptions. In this Subscription-level resource patterns drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 4

Scenario: An engineer needs to explain deployment history and correlation IDs. In this Subscription-level resource patterns drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 5

Scenario: A team is splitting a monolithic template into ownership domains. In this Subscription-level resource patterns drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 6

Scenario: A release must support both cloud-hosted and private agents. In this Subscription-level resource patterns drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 7

Scenario: An environment has drift that must be reconciled before deployment. In this Subscription-level resource patterns drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 8

Scenario: A parameter-file change could expose secrets in source control. In this Subscription-level resource patterns drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 9

Scenario: A policy assignment blocks an otherwise valid deployment. In this Subscription-level resource patterns drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 10

Scenario: A stack deletion plan might detach or remove production assets. In this Subscription-level resource patterns drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 11

Scenario: A product team is moving a manually configured web workload into version control. In this Subscription-level resource patterns drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 12

Scenario: A regulated payment service needs a separate production boundary. In this Subscription-level resource patterns drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 13

Scenario: A platform team is publishing shared modules for dozens of teams. In this Subscription-level resource patterns drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 14

Scenario: An acquisition introduces existing subscriptions and naming rules. In this Subscription-level resource patterns drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 15

Scenario: A deployment must preserve an existing database and its data. In this Subscription-level resource patterns drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 16

Scenario: A pipeline currently uses a long-lived service-principal secret. In this Subscription-level resource patterns drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 17

Scenario: A regional rollout needs consistent network and policy baselines. In this Subscription-level resource patterns drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 18

Scenario: A deployment preview shows unexpected resource replacement. In this Subscription-level resource patterns drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 19

Scenario: A team needs per-environment values without copying templates. In this Subscription-level resource patterns drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 20

Scenario: A resource provider API version changes its required property shape. In this Subscription-level resource patterns drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 21

Scenario: An auditor needs reproducible evidence for each infrastructure change. In this Subscription-level resource patterns drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 22

Scenario: A shared module has breaking changes planned for a new release. In this Subscription-level resource patterns drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 23

Scenario: A policy denies public endpoints but a legacy system depends on one. In this Subscription-level resource patterns drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 24

Scenario: A team needs separate owners for subscription and workload resources. In this Subscription-level resource patterns drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 25

Scenario: A failed pipeline leaves a partially completed deployment. In this Subscription-level resource patterns drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 26

Scenario: A development environment must be safely torn down every sprint. In this Subscription-level resource patterns drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 27

Scenario: A production change must pass review before any write operation. In this Subscription-level resource patterns drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 28

Scenario: A nested module unexpectedly deploys to the wrong scope. In this Subscription-level resource patterns drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 29

Scenario: A template contains a secret copied from a local parameter file. In this Subscription-level resource patterns drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 30

Scenario: A release introduces a naming collision in one environment. In this Subscription-level resource patterns drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 31

Scenario: A central team wants to enforce diagnostic settings consistently. In this Subscription-level resource patterns drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 32

Scenario: A deployment stack may delete resources removed from its template. In this Subscription-level resource patterns drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 33

Scenario: A module registry artifact is missing or inaccessible in CI. In this Subscription-level resource patterns drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 34

Scenario: A resource is changed manually after a successful deployment. In this Subscription-level resource patterns drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 35

Scenario: A what-if report contains many no-change and unsupported lines. In this Subscription-level resource patterns drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 36

Scenario: A pipeline needs to deploy to multiple subscriptions with OIDC. In this Subscription-level resource patterns drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 37

Scenario: A team is migrating a large ARM JSON template incrementally. In this Subscription-level resource patterns drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 38

Scenario: A compliance team needs a time-bounded exception process. In this Subscription-level resource patterns drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 39

Scenario: A deployment is close to subscription quota limits. In this Subscription-level resource patterns drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 40

Scenario: A shared platform module has no clear deprecation policy. In this Subscription-level resource patterns drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 41

Scenario: A stack uses deny settings that could block child resource changes. In this Subscription-level resource patterns drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 42

Scenario: A resource is supported only in selected Azure regions. In this Subscription-level resource patterns drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 43

Scenario: A team must restore a prior configuration after a faulty change. In this Subscription-level resource patterns drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 44

Scenario: A deployment uses a Key Vault reference from another subscription. In this Subscription-level resource patterns drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 45

Scenario: A module output accidentally exposes a sensitive endpoint token. In this Subscription-level resource patterns drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 46

Scenario: A new service needs diagnostic, monitoring, and backup coverage. In this Subscription-level resource patterns drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 47

Scenario: A team is standardizing tags and resource naming in Bicep. In this Subscription-level resource patterns drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 48

Scenario: A pipeline must separate validation credentials from deployment identity. In this Subscription-level resource patterns drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Deployment and ownership diagram

Git change → Bicep build / lint → validation → what-if review → scoped identity → ARM deployment → resource provider → activity/deployment evidence

Mark credential boundaries, approval ownership, correlation IDs and safe stop points at each transition.

Change sequence

1. Record desired state and affected owners

2. Build/lint locally and review the diff

3. Run validate and what-if at target scope

4. Approve and deploy in stages

5. Check resources, activity log and workload health

6. Retain evidence and rollback decision

Read-only and local commands

az bicep version
az bicep build --file main.bicep
az bicep lint --file main.bicep
az deployment group validate --resource-group <rg> --template-file main.bicep
az deployment group what-if --resource-group <rg> --template-file main.bicep
az deployment group show --resource-group <rg> --name <deployment-name>

Run az account show first to confirm tenant, subscription and principal. Validate and what-if can perform preflight checks and require read access; create/update commands submit writes. Production deployment requires reviewed authorization and change plan.

Guided lab / 指导实验

Goal: deliver an auditable Bicep change for Subscription-level resource patterns. (1) Use a sandbox subscription/resource group and confirm caller identity. (2) Copy the sample into a Git branch. (3) express environment differences in parameter files rather than template copies. (4) build, lint and validate. (5) retain what-if output and explain Create/Modify/Delete/NoChange/Ignore line by line. (6) deploy only in the approved lab scope. (7) verify with Azure queries and workload probes. (8) if preview and outcome diverge, stop and retain deployment operations, correlation ID and activity log. Deliver Bicep, sample parameters, preview, verification evidence and rollback note.

Acceptance rubric / 验收标准

Pass only when the template builds, lint findings are dispositioned, parameter and identity boundaries are explicit, what-if has no unexplained destructive change, and deployment output is independently verified.

Production readiness / 生产就绪评审

Scenario: A cost review asks which resources a template owns. Review the production rollout for Subscription-level resource patterns. Submit maintenance window, blast radius, change owner, approver, concurrency policy, quota checks, diagnostics/alerts, rollback trigger, data recovery and business communication. Identify template-owned resources versus existing/external dependencies, consequences of delete or detach, and stop gates for API/module upgrade failure.

Failure-mode rehearsal / 故障演练

Run a tabletop for a denied role assignment, provider validation error, partial deployment, unexpected replacement, throttling and a broken health probe. Assign who stops rollout, who gathers evidence, who restores the last known-good declaration and who communicates status.

Evidence-first troubleshooting / 证据优先排错

For a Subscription-level resource patterns failure, pause retries and automatic promotion. Record commit, CLI/Bicep versions, tenant/subscription/resource group, deployment name and time. Inspect deployment operations, error code, target resource, correlation ID and Activity Log; classify as compiler/type, ARM preflight, RBAC/policy, provider/quota, dependency/runtime or pipeline artifact issue. Preserve raw responses; never use broad permissions, disabled policy or Complete mode as a generic fix.

Knowledge check / 知识检查

Question 1: Subscription-level resource patterns — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 2: Subscription-level resource patterns — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 3: Subscription-level resource patterns — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 4: Subscription-level resource patterns — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 5: Subscription-level resource patterns — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Instructor narration / 讲师讲解提纲

Explain the business value of Subscription-level resource patterns in five minutes. Ask learners to identify state ownership, then draw inputs, resource graph, authorization path and verification evidence. Have a peer act as change approver and challenge destructive differences, secret handling and rollback ownership. Each learner closes with one verified fact, one assumption and one sandbox-safe validation.

Next →

Management-group and tenant deployments

Hour 5 · Module 4 · 7 min
BicepAzure Resource ManagerEnglish original · Source of truth for the Chinese translation. Verified against current Microsoft Learn documentation.

Core model

Choose resource-group, subscription, management-group or tenant scope and coordinate cross-scope deployments with explicit ownership and least privilege.

This module uses Management-group and tenant deployments to connect language syntax, ARM evaluation, provider behavior and team ownership. Before writing declarations, identify target scope, resource owner, input source, dependency edges, observable evidence and recovery action.

Key principle: Bicep compiles to ARM JSON and Azure Resource Manager orchestrates resource state. Repeatability is not a safety guarantee; API versions, mutability, external dependencies and authorization still require independent review.

Worked Bicep example

param appName string
param location string

resource app 'Microsoft.Web/sites@2023-12-01' = {
  name: appName
  location: location
  kind: 'app,linux'
  properties: { httpsOnly: true }
}

output appHost string = app.properties.defaultHostName

Trace targetScope, parameter provenance, symbolic references, implicit dependencies and output contract. Validate names, API versions and properties against the target environment and current provider schema.

Design review / 设计评审

Review questions: Who owns Management-group and tenant deployments? Can callers infer defaults? Are inputs constrained by types? What happens on redeploy, manual drift, concurrent change or retry? Could an immutable property replace production data? How can deployment evidence be retained without exposing secrets?

Self-paced practice: choose one or two clinics; the hour schedule is not intended to complete every prompt.

Architecture clinic 1

Scenario: A release must support both cloud-hosted and private agents. In this Management-group and tenant deployments drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 2

Scenario: An environment has drift that must be reconciled before deployment. In this Management-group and tenant deployments drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 3

Scenario: A parameter-file change could expose secrets in source control. In this Management-group and tenant deployments drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 4

Scenario: A policy assignment blocks an otherwise valid deployment. In this Management-group and tenant deployments drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 5

Scenario: A stack deletion plan might detach or remove production assets. In this Management-group and tenant deployments drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 6

Scenario: A product team is moving a manually configured web workload into version control. In this Management-group and tenant deployments drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 7

Scenario: A regulated payment service needs a separate production boundary. In this Management-group and tenant deployments drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 8

Scenario: A platform team is publishing shared modules for dozens of teams. In this Management-group and tenant deployments drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 9

Scenario: An acquisition introduces existing subscriptions and naming rules. In this Management-group and tenant deployments drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 10

Scenario: A deployment must preserve an existing database and its data. In this Management-group and tenant deployments drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 11

Scenario: A pipeline currently uses a long-lived service-principal secret. In this Management-group and tenant deployments drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 12

Scenario: A regional rollout needs consistent network and policy baselines. In this Management-group and tenant deployments drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 13

Scenario: A deployment preview shows unexpected resource replacement. In this Management-group and tenant deployments drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 14

Scenario: A team needs per-environment values without copying templates. In this Management-group and tenant deployments drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 15

Scenario: A resource provider API version changes its required property shape. In this Management-group and tenant deployments drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 16

Scenario: An auditor needs reproducible evidence for each infrastructure change. In this Management-group and tenant deployments drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 17

Scenario: A shared module has breaking changes planned for a new release. In this Management-group and tenant deployments drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 18

Scenario: A policy denies public endpoints but a legacy system depends on one. In this Management-group and tenant deployments drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 19

Scenario: A team needs separate owners for subscription and workload resources. In this Management-group and tenant deployments drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 20

Scenario: A failed pipeline leaves a partially completed deployment. In this Management-group and tenant deployments drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 21

Scenario: A development environment must be safely torn down every sprint. In this Management-group and tenant deployments drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 22

Scenario: A production change must pass review before any write operation. In this Management-group and tenant deployments drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 23

Scenario: A nested module unexpectedly deploys to the wrong scope. In this Management-group and tenant deployments drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 24

Scenario: A template contains a secret copied from a local parameter file. In this Management-group and tenant deployments drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 25

Scenario: A release introduces a naming collision in one environment. In this Management-group and tenant deployments drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 26

Scenario: A central team wants to enforce diagnostic settings consistently. In this Management-group and tenant deployments drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 27

Scenario: A deployment stack may delete resources removed from its template. In this Management-group and tenant deployments drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 28

Scenario: A module registry artifact is missing or inaccessible in CI. In this Management-group and tenant deployments drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 29

Scenario: A resource is changed manually after a successful deployment. In this Management-group and tenant deployments drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 30

Scenario: A what-if report contains many no-change and unsupported lines. In this Management-group and tenant deployments drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 31

Scenario: A pipeline needs to deploy to multiple subscriptions with OIDC. In this Management-group and tenant deployments drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 32

Scenario: A team is migrating a large ARM JSON template incrementally. In this Management-group and tenant deployments drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 33

Scenario: A compliance team needs a time-bounded exception process. In this Management-group and tenant deployments drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 34

Scenario: A deployment is close to subscription quota limits. In this Management-group and tenant deployments drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 35

Scenario: A shared platform module has no clear deprecation policy. In this Management-group and tenant deployments drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 36

Scenario: A stack uses deny settings that could block child resource changes. In this Management-group and tenant deployments drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 37

Scenario: A resource is supported only in selected Azure regions. In this Management-group and tenant deployments drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 38

Scenario: A team must restore a prior configuration after a faulty change. In this Management-group and tenant deployments drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 39

Scenario: A deployment uses a Key Vault reference from another subscription. In this Management-group and tenant deployments drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 40

Scenario: A module output accidentally exposes a sensitive endpoint token. In this Management-group and tenant deployments drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 41

Scenario: A new service needs diagnostic, monitoring, and backup coverage. In this Management-group and tenant deployments drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 42

Scenario: A team is standardizing tags and resource naming in Bicep. In this Management-group and tenant deployments drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 43

Scenario: A pipeline must separate validation credentials from deployment identity. In this Management-group and tenant deployments drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 44

Scenario: A management group deployment needs carefully scoped assignments. In this Management-group and tenant deployments drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 45

Scenario: A module change passes build but fails at provider validation. In this Management-group and tenant deployments drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 46

Scenario: An environment promotion must compare source and target configuration. In this Management-group and tenant deployments drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 47

Scenario: A team wants to test snapshots without querying live Azure. In this Management-group and tenant deployments drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 48

Scenario: A production resource has immutable properties that cannot be replaced. In this Management-group and tenant deployments drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Deployment and ownership diagram

Git change → Bicep build / lint → validation → what-if review → scoped identity → ARM deployment → resource provider → activity/deployment evidence

Mark credential boundaries, approval ownership, correlation IDs and safe stop points at each transition.

Change sequence

1. Record desired state and affected owners

2. Build/lint locally and review the diff

3. Run validate and what-if at target scope

4. Approve and deploy in stages

5. Check resources, activity log and workload health

6. Retain evidence and rollback decision

Read-only and local commands

az bicep version
az bicep build --file main.bicep
az bicep lint --file main.bicep
az deployment group validate --resource-group <rg> --template-file main.bicep
az deployment group what-if --resource-group <rg> --template-file main.bicep
az deployment group show --resource-group <rg> --name <deployment-name>

Run az account show first to confirm tenant, subscription and principal. Validate and what-if can perform preflight checks and require read access; create/update commands submit writes. Production deployment requires reviewed authorization and change plan.

Guided lab / 指导实验

Goal: deliver an auditable Bicep change for Management-group and tenant deployments. (1) Use a sandbox subscription/resource group and confirm caller identity. (2) Copy the sample into a Git branch. (3) express environment differences in parameter files rather than template copies. (4) build, lint and validate. (5) retain what-if output and explain Create/Modify/Delete/NoChange/Ignore line by line. (6) deploy only in the approved lab scope. (7) verify with Azure queries and workload probes. (8) if preview and outcome diverge, stop and retain deployment operations, correlation ID and activity log. Deliver Bicep, sample parameters, preview, verification evidence and rollback note.

Acceptance rubric / 验收标准

Pass only when the template builds, lint findings are dispositioned, parameter and identity boundaries are explicit, what-if has no unexplained destructive change, and deployment output is independently verified.

Production readiness / 生产就绪评审

Scenario: A resource group is created separately from its workload resources. Review the production rollout for Management-group and tenant deployments. Submit maintenance window, blast radius, change owner, approver, concurrency policy, quota checks, diagnostics/alerts, rollback trigger, data recovery and business communication. Identify template-owned resources versus existing/external dependencies, consequences of delete or detach, and stop gates for API/module upgrade failure.

Failure-mode rehearsal / 故障演练

Run a tabletop for a denied role assignment, provider validation error, partial deployment, unexpected replacement, throttling and a broken health probe. Assign who stops rollout, who gathers evidence, who restores the last known-good declaration and who communicates status.

Evidence-first troubleshooting / 证据优先排错

For a Management-group and tenant deployments failure, pause retries and automatic promotion. Record commit, CLI/Bicep versions, tenant/subscription/resource group, deployment name and time. Inspect deployment operations, error code, target resource, correlation ID and Activity Log; classify as compiler/type, ARM preflight, RBAC/policy, provider/quota, dependency/runtime or pipeline artifact issue. Preserve raw responses; never use broad permissions, disabled policy or Complete mode as a generic fix.

Knowledge check / 知识检查

Question 1: Management-group and tenant deployments — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 2: Management-group and tenant deployments — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 3: Management-group and tenant deployments — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 4: Management-group and tenant deployments — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 5: Management-group and tenant deployments — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Instructor narration / 讲师讲解提纲

Explain the business value of Management-group and tenant deployments in five minutes. Ask learners to identify state ownership, then draw inputs, resource graph, authorization path and verification evidence. Have a peer act as change approver and challenge destructive differences, secret handling and rollback ownership. Each learner closes with one verified fact, one assumption and one sandbox-safe validation.

Next →

Cross-scope module orchestration

Hour 5 · Module 5 · 7 min
BicepAzure Resource ManagerEnglish original · Source of truth for the Chinese translation. Verified against current Microsoft Learn documentation.

Core model

Choose resource-group, subscription, management-group or tenant scope and coordinate cross-scope deployments with explicit ownership and least privilege.

This module uses Cross-scope module orchestration to connect language syntax, ARM evaluation, provider behavior and team ownership. Before writing declarations, identify target scope, resource owner, input source, dependency edges, observable evidence and recovery action.

Key principle: Bicep compiles to ARM JSON and Azure Resource Manager orchestrates resource state. Repeatability is not a safety guarantee; API versions, mutability, external dependencies and authorization still require independent review.

Worked Bicep example

targetScope = 'resourceGroup'

param location string = resourceGroup().location
param storageName string

resource storage 'Microsoft.Storage/storageAccounts@2023-05-01' = {
  name: storageName
  location: location
  sku: { name: 'Standard_LRS' }
  kind: 'StorageV2'
  properties: { supportsHttpsTrafficOnly: true }
}

output resourceId string = storage.id

Trace targetScope, parameter provenance, symbolic references, implicit dependencies and output contract. Validate names, API versions and properties against the target environment and current provider schema.

Design review / 设计评审

Review questions: Who owns Cross-scope module orchestration? Can callers infer defaults? Are inputs constrained by types? What happens on redeploy, manual drift, concurrent change or retry? Could an immutable property replace production data? How can deployment evidence be retained without exposing secrets?

Self-paced practice: choose one or two clinics; the hour schedule is not intended to complete every prompt.

Architecture clinic 1

Scenario: A product team is moving a manually configured web workload into version control. In this Cross-scope module orchestration drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 2

Scenario: A regulated payment service needs a separate production boundary. In this Cross-scope module orchestration drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 3

Scenario: A platform team is publishing shared modules for dozens of teams. In this Cross-scope module orchestration drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 4

Scenario: An acquisition introduces existing subscriptions and naming rules. In this Cross-scope module orchestration drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 5

Scenario: A deployment must preserve an existing database and its data. In this Cross-scope module orchestration drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 6

Scenario: A pipeline currently uses a long-lived service-principal secret. In this Cross-scope module orchestration drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 7

Scenario: A regional rollout needs consistent network and policy baselines. In this Cross-scope module orchestration drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 8

Scenario: A deployment preview shows unexpected resource replacement. In this Cross-scope module orchestration drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 9

Scenario: A team needs per-environment values without copying templates. In this Cross-scope module orchestration drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 10

Scenario: A resource provider API version changes its required property shape. In this Cross-scope module orchestration drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 11

Scenario: An auditor needs reproducible evidence for each infrastructure change. In this Cross-scope module orchestration drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 12

Scenario: A shared module has breaking changes planned for a new release. In this Cross-scope module orchestration drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 13

Scenario: A policy denies public endpoints but a legacy system depends on one. In this Cross-scope module orchestration drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 14

Scenario: A team needs separate owners for subscription and workload resources. In this Cross-scope module orchestration drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 15

Scenario: A failed pipeline leaves a partially completed deployment. In this Cross-scope module orchestration drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 16

Scenario: A development environment must be safely torn down every sprint. In this Cross-scope module orchestration drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 17

Scenario: A production change must pass review before any write operation. In this Cross-scope module orchestration drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 18

Scenario: A nested module unexpectedly deploys to the wrong scope. In this Cross-scope module orchestration drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 19

Scenario: A template contains a secret copied from a local parameter file. In this Cross-scope module orchestration drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 20

Scenario: A release introduces a naming collision in one environment. In this Cross-scope module orchestration drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 21

Scenario: A central team wants to enforce diagnostic settings consistently. In this Cross-scope module orchestration drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 22

Scenario: A deployment stack may delete resources removed from its template. In this Cross-scope module orchestration drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 23

Scenario: A module registry artifact is missing or inaccessible in CI. In this Cross-scope module orchestration drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 24

Scenario: A resource is changed manually after a successful deployment. In this Cross-scope module orchestration drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 25

Scenario: A what-if report contains many no-change and unsupported lines. In this Cross-scope module orchestration drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 26

Scenario: A pipeline needs to deploy to multiple subscriptions with OIDC. In this Cross-scope module orchestration drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 27

Scenario: A team is migrating a large ARM JSON template incrementally. In this Cross-scope module orchestration drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 28

Scenario: A compliance team needs a time-bounded exception process. In this Cross-scope module orchestration drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 29

Scenario: A deployment is close to subscription quota limits. In this Cross-scope module orchestration drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 30

Scenario: A shared platform module has no clear deprecation policy. In this Cross-scope module orchestration drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 31

Scenario: A stack uses deny settings that could block child resource changes. In this Cross-scope module orchestration drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 32

Scenario: A resource is supported only in selected Azure regions. In this Cross-scope module orchestration drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 33

Scenario: A team must restore a prior configuration after a faulty change. In this Cross-scope module orchestration drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 34

Scenario: A deployment uses a Key Vault reference from another subscription. In this Cross-scope module orchestration drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 35

Scenario: A module output accidentally exposes a sensitive endpoint token. In this Cross-scope module orchestration drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 36

Scenario: A new service needs diagnostic, monitoring, and backup coverage. In this Cross-scope module orchestration drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 37

Scenario: A team is standardizing tags and resource naming in Bicep. In this Cross-scope module orchestration drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 38

Scenario: A pipeline must separate validation credentials from deployment identity. In this Cross-scope module orchestration drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 39

Scenario: A management group deployment needs carefully scoped assignments. In this Cross-scope module orchestration drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 40

Scenario: A module change passes build but fails at provider validation. In this Cross-scope module orchestration drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 41

Scenario: An environment promotion must compare source and target configuration. In this Cross-scope module orchestration drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 42

Scenario: A team wants to test snapshots without querying live Azure. In this Cross-scope module orchestration drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 43

Scenario: A production resource has immutable properties that cannot be replaced. In this Cross-scope module orchestration drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 44

Scenario: A module uses experimental features without an upgrade owner. In this Cross-scope module orchestration drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 45

Scenario: A cost review asks which resources a template owns. In this Cross-scope module orchestration drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 46

Scenario: A team needs an audited emergency deployment path. In this Cross-scope module orchestration drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 47

Scenario: A public module dependency changes upstream behavior. In this Cross-scope module orchestration drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 48

Scenario: A resource group is created separately from its workload resources. In this Cross-scope module orchestration drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Deployment and ownership diagram

Git change → Bicep build / lint → validation → what-if review → scoped identity → ARM deployment → resource provider → activity/deployment evidence

Mark credential boundaries, approval ownership, correlation IDs and safe stop points at each transition.

Change sequence

1. Record desired state and affected owners

2. Build/lint locally and review the diff

3. Run validate and what-if at target scope

4. Approve and deploy in stages

5. Check resources, activity log and workload health

6. Retain evidence and rollback decision

Read-only and local commands

az bicep version
az bicep build --file main.bicep
az bicep lint --file main.bicep
az deployment group validate --resource-group <rg> --template-file main.bicep
az deployment group what-if --resource-group <rg> --template-file main.bicep
az deployment group show --resource-group <rg> --name <deployment-name>

Run az account show first to confirm tenant, subscription and principal. Validate and what-if can perform preflight checks and require read access; create/update commands submit writes. Production deployment requires reviewed authorization and change plan.

Guided lab / 指导实验

Goal: deliver an auditable Bicep change for Cross-scope module orchestration. (1) Use a sandbox subscription/resource group and confirm caller identity. (2) Copy the sample into a Git branch. (3) express environment differences in parameter files rather than template copies. (4) build, lint and validate. (5) retain what-if output and explain Create/Modify/Delete/NoChange/Ignore line by line. (6) deploy only in the approved lab scope. (7) verify with Azure queries and workload probes. (8) if preview and outcome diverge, stop and retain deployment operations, correlation ID and activity log. Deliver Bicep, sample parameters, preview, verification evidence and rollback note.

Acceptance rubric / 验收标准

Pass only when the template builds, lint findings are dispositioned, parameter and identity boundaries are explicit, what-if has no unexplained destructive change, and deployment output is independently verified.

Production readiness / 生产就绪评审

Scenario: A service team needs to roll back an API-version update. Review the production rollout for Cross-scope module orchestration. Submit maintenance window, blast radius, change owner, approver, concurrency policy, quota checks, diagnostics/alerts, rollback trigger, data recovery and business communication. Identify template-owned resources versus existing/external dependencies, consequences of delete or detach, and stop gates for API/module upgrade failure.

Failure-mode rehearsal / 故障演练

Run a tabletop for a denied role assignment, provider validation error, partial deployment, unexpected replacement, throttling and a broken health probe. Assign who stops rollout, who gathers evidence, who restores the last known-good declaration and who communicates status.

Evidence-first troubleshooting / 证据优先排错

For a Cross-scope module orchestration failure, pause retries and automatic promotion. Record commit, CLI/Bicep versions, tenant/subscription/resource group, deployment name and time. Inspect deployment operations, error code, target resource, correlation ID and Activity Log; classify as compiler/type, ARM preflight, RBAC/policy, provider/quota, dependency/runtime or pipeline artifact issue. Preserve raw responses; never use broad permissions, disabled policy or Complete mode as a generic fix.

Knowledge check / 知识检查

Question 1: Cross-scope module orchestration — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 2: Cross-scope module orchestration — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 3: Cross-scope module orchestration — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 4: Cross-scope module orchestration — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 5: Cross-scope module orchestration — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Instructor narration / 讲师讲解提纲

Explain the business value of Cross-scope module orchestration in five minutes. Ask learners to identify state ownership, then draw inputs, resource graph, authorization path and verification evidence. Have a peer act as change approver and challenge destructive differences, secret handling and rollback ownership. Each learner closes with one verified fact, one assumption and one sandbox-safe validation.

Next →

Deployment names, location and history

Hour 5 · Module 6 · 7 min
BicepAzure Resource ManagerEnglish original · Source of truth for the Chinese translation. Verified against current Microsoft Learn documentation.

Core model

Choose resource-group, subscription, management-group or tenant scope and coordinate cross-scope deployments with explicit ownership and least privilege.

This module uses Deployment names, location and history to connect language syntax, ARM evaluation, provider behavior and team ownership. Before writing declarations, identify target scope, resource owner, input source, dependency edges, observable evidence and recovery action.

Key principle: Bicep compiles to ARM JSON and Azure Resource Manager orchestrates resource state. Repeatability is not a safety guarantee; API versions, mutability, external dependencies and authorization still require independent review.

Worked Bicep example

@description('Deployment environment')
@allowed([
  'dev'
  'test'
  'prod'
])
param environment string

@secure()
param bootstrapSecret string

var names = {
  dev: 'Development'
  test: 'Test'
  prod: 'Production'
}

output environmentLabel string = names[environment]

Trace targetScope, parameter provenance, symbolic references, implicit dependencies and output contract. Validate names, API versions and properties against the target environment and current provider schema.

Design review / 设计评审

Review questions: Who owns Deployment names, location and history? Can callers infer defaults? Are inputs constrained by types? What happens on redeploy, manual drift, concurrent change or retry? Could an immutable property replace production data? How can deployment evidence be retained without exposing secrets?

Self-paced practice: choose one or two clinics; the hour schedule is not intended to complete every prompt.

Architecture clinic 1

Scenario: A pipeline currently uses a long-lived service-principal secret. In this Deployment names, location and history drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 2

Scenario: A regional rollout needs consistent network and policy baselines. In this Deployment names, location and history drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 3

Scenario: A deployment preview shows unexpected resource replacement. In this Deployment names, location and history drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 4

Scenario: A team needs per-environment values without copying templates. In this Deployment names, location and history drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 5

Scenario: A resource provider API version changes its required property shape. In this Deployment names, location and history drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 6

Scenario: An auditor needs reproducible evidence for each infrastructure change. In this Deployment names, location and history drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 7

Scenario: A shared module has breaking changes planned for a new release. In this Deployment names, location and history drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 8

Scenario: A policy denies public endpoints but a legacy system depends on one. In this Deployment names, location and history drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 9

Scenario: A team needs separate owners for subscription and workload resources. In this Deployment names, location and history drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 10

Scenario: A failed pipeline leaves a partially completed deployment. In this Deployment names, location and history drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 11

Scenario: A development environment must be safely torn down every sprint. In this Deployment names, location and history drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 12

Scenario: A production change must pass review before any write operation. In this Deployment names, location and history drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 13

Scenario: A nested module unexpectedly deploys to the wrong scope. In this Deployment names, location and history drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 14

Scenario: A template contains a secret copied from a local parameter file. In this Deployment names, location and history drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 15

Scenario: A release introduces a naming collision in one environment. In this Deployment names, location and history drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 16

Scenario: A central team wants to enforce diagnostic settings consistently. In this Deployment names, location and history drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 17

Scenario: A deployment stack may delete resources removed from its template. In this Deployment names, location and history drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 18

Scenario: A module registry artifact is missing or inaccessible in CI. In this Deployment names, location and history drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 19

Scenario: A resource is changed manually after a successful deployment. In this Deployment names, location and history drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 20

Scenario: A what-if report contains many no-change and unsupported lines. In this Deployment names, location and history drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 21

Scenario: A pipeline needs to deploy to multiple subscriptions with OIDC. In this Deployment names, location and history drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 22

Scenario: A team is migrating a large ARM JSON template incrementally. In this Deployment names, location and history drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 23

Scenario: A compliance team needs a time-bounded exception process. In this Deployment names, location and history drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 24

Scenario: A deployment is close to subscription quota limits. In this Deployment names, location and history drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 25

Scenario: A shared platform module has no clear deprecation policy. In this Deployment names, location and history drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 26

Scenario: A stack uses deny settings that could block child resource changes. In this Deployment names, location and history drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 27

Scenario: A resource is supported only in selected Azure regions. In this Deployment names, location and history drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 28

Scenario: A team must restore a prior configuration after a faulty change. In this Deployment names, location and history drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 29

Scenario: A deployment uses a Key Vault reference from another subscription. In this Deployment names, location and history drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 30

Scenario: A module output accidentally exposes a sensitive endpoint token. In this Deployment names, location and history drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 31

Scenario: A new service needs diagnostic, monitoring, and backup coverage. In this Deployment names, location and history drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 32

Scenario: A team is standardizing tags and resource naming in Bicep. In this Deployment names, location and history drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 33

Scenario: A pipeline must separate validation credentials from deployment identity. In this Deployment names, location and history drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 34

Scenario: A management group deployment needs carefully scoped assignments. In this Deployment names, location and history drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 35

Scenario: A module change passes build but fails at provider validation. In this Deployment names, location and history drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 36

Scenario: An environment promotion must compare source and target configuration. In this Deployment names, location and history drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 37

Scenario: A team wants to test snapshots without querying live Azure. In this Deployment names, location and history drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 38

Scenario: A production resource has immutable properties that cannot be replaced. In this Deployment names, location and history drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 39

Scenario: A module uses experimental features without an upgrade owner. In this Deployment names, location and history drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 40

Scenario: A cost review asks which resources a template owns. In this Deployment names, location and history drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 41

Scenario: A team needs an audited emergency deployment path. In this Deployment names, location and history drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 42

Scenario: A public module dependency changes upstream behavior. In this Deployment names, location and history drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 43

Scenario: A resource group is created separately from its workload resources. In this Deployment names, location and history drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 44

Scenario: A cleanup request could remove shared networking by mistake. In this Deployment names, location and history drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 45

Scenario: A template has hard-coded environment names in several modules. In this Deployment names, location and history drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 46

Scenario: A service team needs to roll back an API-version update. In this Deployment names, location and history drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 47

Scenario: A deployment has a dependency cycle across modules. In this Deployment names, location and history drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 48

Scenario: A template should adopt secure defaults without blocking exceptions. In this Deployment names, location and history drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Deployment and ownership diagram

Git change → Bicep build / lint → validation → what-if review → scoped identity → ARM deployment → resource provider → activity/deployment evidence

Mark credential boundaries, approval ownership, correlation IDs and safe stop points at each transition.

Change sequence

1. Record desired state and affected owners

2. Build/lint locally and review the diff

3. Run validate and what-if at target scope

4. Approve and deploy in stages

5. Check resources, activity log and workload health

6. Retain evidence and rollback decision

Read-only and local commands

az bicep version
az bicep build --file main.bicep
az bicep lint --file main.bicep
az deployment group validate --resource-group <rg> --template-file main.bicep
az deployment group what-if --resource-group <rg> --template-file main.bicep
az deployment group show --resource-group <rg> --name <deployment-name>

Run az account show first to confirm tenant, subscription and principal. Validate and what-if can perform preflight checks and require read access; create/update commands submit writes. Production deployment requires reviewed authorization and change plan.

Guided lab / 指导实验

Goal: deliver an auditable Bicep change for Deployment names, location and history. (1) Use a sandbox subscription/resource group and confirm caller identity. (2) Copy the sample into a Git branch. (3) express environment differences in parameter files rather than template copies. (4) build, lint and validate. (5) retain what-if output and explain Create/Modify/Delete/NoChange/Ignore line by line. (6) deploy only in the approved lab scope. (7) verify with Azure queries and workload probes. (8) if preview and outcome diverge, stop and retain deployment operations, correlation ID and activity log. Deliver Bicep, sample parameters, preview, verification evidence and rollback note.

Acceptance rubric / 验收标准

Pass only when the template builds, lint findings are dispositioned, parameter and identity boundaries are explicit, what-if has no unexplained destructive change, and deployment output is independently verified.

Production readiness / 生产就绪评审

Scenario: An engineer needs to explain deployment history and correlation IDs. Review the production rollout for Deployment names, location and history. Submit maintenance window, blast radius, change owner, approver, concurrency policy, quota checks, diagnostics/alerts, rollback trigger, data recovery and business communication. Identify template-owned resources versus existing/external dependencies, consequences of delete or detach, and stop gates for API/module upgrade failure.

Failure-mode rehearsal / 故障演练

Run a tabletop for a denied role assignment, provider validation error, partial deployment, unexpected replacement, throttling and a broken health probe. Assign who stops rollout, who gathers evidence, who restores the last known-good declaration and who communicates status.

Evidence-first troubleshooting / 证据优先排错

For a Deployment names, location and history failure, pause retries and automatic promotion. Record commit, CLI/Bicep versions, tenant/subscription/resource group, deployment name and time. Inspect deployment operations, error code, target resource, correlation ID and Activity Log; classify as compiler/type, ARM preflight, RBAC/policy, provider/quota, dependency/runtime or pipeline artifact issue. Preserve raw responses; never use broad permissions, disabled policy or Complete mode as a generic fix.

Knowledge check / 知识检查

Question 1: Deployment names, location and history — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 2: Deployment names, location and history — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 3: Deployment names, location and history — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 4: Deployment names, location and history — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 5: Deployment names, location and history — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Instructor narration / 讲师讲解提纲

Explain the business value of Deployment names, location and history in five minutes. Ask learners to identify state ownership, then draw inputs, resource graph, authorization path and verification evidence. Have a peer act as change approver and challenge destructive differences, secret handling and rollback ownership. Each learner closes with one verified fact, one assumption and one sandbox-safe validation.

Next →

Platform baseline orchestration lab

Hour 5 · Module 7 · 7 min
BicepAzure Resource ManagerEnglish original · Source of truth for the Chinese translation. Verified against current Microsoft Learn documentation.

Core model

Choose resource-group, subscription, management-group or tenant scope and coordinate cross-scope deployments with explicit ownership and least privilege.

This module uses Platform baseline orchestration lab to connect language syntax, ARM evaluation, provider behavior and team ownership. Before writing declarations, identify target scope, resource owner, input source, dependency edges, observable evidence and recovery action.

Key principle: Bicep compiles to ARM JSON and Azure Resource Manager orchestrates resource state. Repeatability is not a safety guarantee; API versions, mutability, external dependencies and authorization still require independent review.

Worked Bicep example

param vnetName string
param subnetPrefixes array

resource vnet 'Microsoft.Network/virtualNetworks@2023-09-01' = {
  name: vnetName
  location: resourceGroup().location
  properties: {
    addressSpace: { addressPrefixes: [ '10.40.0.0/16' ] }
    subnets: [for (prefix, i) in subnetPrefixes: {
      name: 'subnet-${i}'
      properties: {
        addressPrefix: prefix
      }
    }]
  }
}

Trace targetScope, parameter provenance, symbolic references, implicit dependencies and output contract. Validate names, API versions and properties against the target environment and current provider schema.

Design review / 设计评审

Review questions: Who owns Platform baseline orchestration lab? Can callers infer defaults? Are inputs constrained by types? What happens on redeploy, manual drift, concurrent change or retry? Could an immutable property replace production data? How can deployment evidence be retained without exposing secrets?

Self-paced practice: choose one or two clinics; the hour schedule is not intended to complete every prompt.

Architecture clinic 1

Scenario: An auditor needs reproducible evidence for each infrastructure change. In this Platform baseline orchestration lab drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 2

Scenario: A shared module has breaking changes planned for a new release. In this Platform baseline orchestration lab drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 3

Scenario: A policy denies public endpoints but a legacy system depends on one. In this Platform baseline orchestration lab drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 4

Scenario: A team needs separate owners for subscription and workload resources. In this Platform baseline orchestration lab drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 5

Scenario: A failed pipeline leaves a partially completed deployment. In this Platform baseline orchestration lab drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 6

Scenario: A development environment must be safely torn down every sprint. In this Platform baseline orchestration lab drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 7

Scenario: A production change must pass review before any write operation. In this Platform baseline orchestration lab drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 8

Scenario: A nested module unexpectedly deploys to the wrong scope. In this Platform baseline orchestration lab drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 9

Scenario: A template contains a secret copied from a local parameter file. In this Platform baseline orchestration lab drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 10

Scenario: A release introduces a naming collision in one environment. In this Platform baseline orchestration lab drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 11

Scenario: A central team wants to enforce diagnostic settings consistently. In this Platform baseline orchestration lab drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 12

Scenario: A deployment stack may delete resources removed from its template. In this Platform baseline orchestration lab drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 13

Scenario: A module registry artifact is missing or inaccessible in CI. In this Platform baseline orchestration lab drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 14

Scenario: A resource is changed manually after a successful deployment. In this Platform baseline orchestration lab drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 15

Scenario: A what-if report contains many no-change and unsupported lines. In this Platform baseline orchestration lab drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 16

Scenario: A pipeline needs to deploy to multiple subscriptions with OIDC. In this Platform baseline orchestration lab drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 17

Scenario: A team is migrating a large ARM JSON template incrementally. In this Platform baseline orchestration lab drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 18

Scenario: A compliance team needs a time-bounded exception process. In this Platform baseline orchestration lab drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 19

Scenario: A deployment is close to subscription quota limits. In this Platform baseline orchestration lab drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 20

Scenario: A shared platform module has no clear deprecation policy. In this Platform baseline orchestration lab drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 21

Scenario: A stack uses deny settings that could block child resource changes. In this Platform baseline orchestration lab drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 22

Scenario: A resource is supported only in selected Azure regions. In this Platform baseline orchestration lab drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 23

Scenario: A team must restore a prior configuration after a faulty change. In this Platform baseline orchestration lab drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 24

Scenario: A deployment uses a Key Vault reference from another subscription. In this Platform baseline orchestration lab drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 25

Scenario: A module output accidentally exposes a sensitive endpoint token. In this Platform baseline orchestration lab drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 26

Scenario: A new service needs diagnostic, monitoring, and backup coverage. In this Platform baseline orchestration lab drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 27

Scenario: A team is standardizing tags and resource naming in Bicep. In this Platform baseline orchestration lab drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 28

Scenario: A pipeline must separate validation credentials from deployment identity. In this Platform baseline orchestration lab drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 29

Scenario: A management group deployment needs carefully scoped assignments. In this Platform baseline orchestration lab drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 30

Scenario: A module change passes build but fails at provider validation. In this Platform baseline orchestration lab drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 31

Scenario: An environment promotion must compare source and target configuration. In this Platform baseline orchestration lab drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 32

Scenario: A team wants to test snapshots without querying live Azure. In this Platform baseline orchestration lab drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 33

Scenario: A production resource has immutable properties that cannot be replaced. In this Platform baseline orchestration lab drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 34

Scenario: A module uses experimental features without an upgrade owner. In this Platform baseline orchestration lab drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 35

Scenario: A cost review asks which resources a template owns. In this Platform baseline orchestration lab drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 36

Scenario: A team needs an audited emergency deployment path. In this Platform baseline orchestration lab drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 37

Scenario: A public module dependency changes upstream behavior. In this Platform baseline orchestration lab drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 38

Scenario: A resource group is created separately from its workload resources. In this Platform baseline orchestration lab drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 39

Scenario: A cleanup request could remove shared networking by mistake. In this Platform baseline orchestration lab drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 40

Scenario: A template has hard-coded environment names in several modules. In this Platform baseline orchestration lab drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 41

Scenario: A service team needs to roll back an API-version update. In this Platform baseline orchestration lab drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 42

Scenario: A deployment has a dependency cycle across modules. In this Platform baseline orchestration lab drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 43

Scenario: A template should adopt secure defaults without blocking exceptions. In this Platform baseline orchestration lab drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 44

Scenario: An engineer needs to explain deployment history and correlation IDs. In this Platform baseline orchestration lab drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 45

Scenario: A team is splitting a monolithic template into ownership domains. In this Platform baseline orchestration lab drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 46

Scenario: A release must support both cloud-hosted and private agents. In this Platform baseline orchestration lab drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 47

Scenario: An environment has drift that must be reconciled before deployment. In this Platform baseline orchestration lab drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 48

Scenario: A parameter-file change could expose secrets in source control. In this Platform baseline orchestration lab drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Deployment and ownership diagram

Git change → Bicep build / lint → validation → what-if review → scoped identity → ARM deployment → resource provider → activity/deployment evidence

Mark credential boundaries, approval ownership, correlation IDs and safe stop points at each transition.

Change sequence

1. Record desired state and affected owners

2. Build/lint locally and review the diff

3. Run validate and what-if at target scope

4. Approve and deploy in stages

5. Check resources, activity log and workload health

6. Retain evidence and rollback decision

Read-only and local commands

az bicep version
az bicep build --file main.bicep
az bicep lint --file main.bicep
az deployment group validate --resource-group <rg> --template-file main.bicep
az deployment group what-if --resource-group <rg> --template-file main.bicep
az deployment group show --resource-group <rg> --name <deployment-name>

Run az account show first to confirm tenant, subscription and principal. Validate and what-if can perform preflight checks and require read access; create/update commands submit writes. Production deployment requires reviewed authorization and change plan.

Guided lab / 指导实验

Goal: deliver an auditable Bicep change for Platform baseline orchestration lab. (1) Use a sandbox subscription/resource group and confirm caller identity. (2) Copy the sample into a Git branch. (3) express environment differences in parameter files rather than template copies. (4) build, lint and validate. (5) retain what-if output and explain Create/Modify/Delete/NoChange/Ignore line by line. (6) deploy only in the approved lab scope. (7) verify with Azure queries and workload probes. (8) if preview and outcome diverge, stop and retain deployment operations, correlation ID and activity log. Deliver Bicep, sample parameters, preview, verification evidence and rollback note.

Acceptance rubric / 验收标准

Pass only when the template builds, lint findings are dispositioned, parameter and identity boundaries are explicit, what-if has no unexplained destructive change, and deployment output is independently verified.

Production readiness / 生产就绪评审

Scenario: An environment has drift that must be reconciled before deployment. Review the production rollout for Platform baseline orchestration lab. Submit maintenance window, blast radius, change owner, approver, concurrency policy, quota checks, diagnostics/alerts, rollback trigger, data recovery and business communication. Identify template-owned resources versus existing/external dependencies, consequences of delete or detach, and stop gates for API/module upgrade failure.

Failure-mode rehearsal / 故障演练

Run a tabletop for a denied role assignment, provider validation error, partial deployment, unexpected replacement, throttling and a broken health probe. Assign who stops rollout, who gathers evidence, who restores the last known-good declaration and who communicates status.

Evidence-first troubleshooting / 证据优先排错

For a Platform baseline orchestration lab failure, pause retries and automatic promotion. Record commit, CLI/Bicep versions, tenant/subscription/resource group, deployment name and time. Inspect deployment operations, error code, target resource, correlation ID and Activity Log; classify as compiler/type, ARM preflight, RBAC/policy, provider/quota, dependency/runtime or pipeline artifact issue. Preserve raw responses; never use broad permissions, disabled policy or Complete mode as a generic fix.

Knowledge check / 知识检查

Question 1: Platform baseline orchestration lab — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 2: Platform baseline orchestration lab — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 3: Platform baseline orchestration lab — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 4: Platform baseline orchestration lab — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 5: Platform baseline orchestration lab — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Instructor narration / 讲师讲解提纲

Explain the business value of Platform baseline orchestration lab in five minutes. Ask learners to identify state ownership, then draw inputs, resource graph, authorization path and verification evidence. Have a peer act as change approver and challenge destructive differences, secret handling and rollback ownership. Each learner closes with one verified fact, one assumption and one sandbox-safe validation.

Next →

Scope and role review

Hour 5 · Module 8 · 7 min
BicepAzure Resource ManagerEnglish original · Source of truth for the Chinese translation. Verified against current Microsoft Learn documentation.

Core model

Choose resource-group, subscription, management-group or tenant scope and coordinate cross-scope deployments with explicit ownership and least privilege.

This module uses Scope and role review to connect language syntax, ARM evaluation, provider behavior and team ownership. Before writing declarations, identify target scope, resource owner, input source, dependency edges, observable evidence and recovery action.

Key principle: Bicep compiles to ARM JSON and Azure Resource Manager orchestrates resource state. Repeatability is not a safety guarantee; API versions, mutability, external dependencies and authorization still require independent review.

Worked Bicep example

param location string
param environment string
param addressPrefix string
param diagnosticsWorkspaceId string

module network './modules/network.bicep' = {
  name: 'network-${environment}'
  params: {
    location: location
    addressPrefix: addressPrefix
    diagnosticsWorkspaceId: diagnosticsWorkspaceId
  }
}

output networkId string = network.outputs.vnetId

Trace targetScope, parameter provenance, symbolic references, implicit dependencies and output contract. Validate names, API versions and properties against the target environment and current provider schema.

Design review / 设计评审

Review questions: Who owns Scope and role review? Can callers infer defaults? Are inputs constrained by types? What happens on redeploy, manual drift, concurrent change or retry? Could an immutable property replace production data? How can deployment evidence be retained without exposing secrets?

Self-paced practice: choose one or two clinics; the hour schedule is not intended to complete every prompt.

Architecture clinic 1

Scenario: A development environment must be safely torn down every sprint. In this Scope and role review drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 2

Scenario: A production change must pass review before any write operation. In this Scope and role review drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 3

Scenario: A nested module unexpectedly deploys to the wrong scope. In this Scope and role review drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 4

Scenario: A template contains a secret copied from a local parameter file. In this Scope and role review drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 5

Scenario: A release introduces a naming collision in one environment. In this Scope and role review drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 6

Scenario: A central team wants to enforce diagnostic settings consistently. In this Scope and role review drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 7

Scenario: A deployment stack may delete resources removed from its template. In this Scope and role review drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 8

Scenario: A module registry artifact is missing or inaccessible in CI. In this Scope and role review drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 9

Scenario: A resource is changed manually after a successful deployment. In this Scope and role review drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 10

Scenario: A what-if report contains many no-change and unsupported lines. In this Scope and role review drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 11

Scenario: A pipeline needs to deploy to multiple subscriptions with OIDC. In this Scope and role review drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 12

Scenario: A team is migrating a large ARM JSON template incrementally. In this Scope and role review drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 13

Scenario: A compliance team needs a time-bounded exception process. In this Scope and role review drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 14

Scenario: A deployment is close to subscription quota limits. In this Scope and role review drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 15

Scenario: A shared platform module has no clear deprecation policy. In this Scope and role review drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 16

Scenario: A stack uses deny settings that could block child resource changes. In this Scope and role review drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 17

Scenario: A resource is supported only in selected Azure regions. In this Scope and role review drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 18

Scenario: A team must restore a prior configuration after a faulty change. In this Scope and role review drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 19

Scenario: A deployment uses a Key Vault reference from another subscription. In this Scope and role review drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 20

Scenario: A module output accidentally exposes a sensitive endpoint token. In this Scope and role review drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 21

Scenario: A new service needs diagnostic, monitoring, and backup coverage. In this Scope and role review drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 22

Scenario: A team is standardizing tags and resource naming in Bicep. In this Scope and role review drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 23

Scenario: A pipeline must separate validation credentials from deployment identity. In this Scope and role review drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 24

Scenario: A management group deployment needs carefully scoped assignments. In this Scope and role review drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 25

Scenario: A module change passes build but fails at provider validation. In this Scope and role review drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 26

Scenario: An environment promotion must compare source and target configuration. In this Scope and role review drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 27

Scenario: A team wants to test snapshots without querying live Azure. In this Scope and role review drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 28

Scenario: A production resource has immutable properties that cannot be replaced. In this Scope and role review drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 29

Scenario: A module uses experimental features without an upgrade owner. In this Scope and role review drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 30

Scenario: A cost review asks which resources a template owns. In this Scope and role review drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 31

Scenario: A team needs an audited emergency deployment path. In this Scope and role review drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 32

Scenario: A public module dependency changes upstream behavior. In this Scope and role review drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 33

Scenario: A resource group is created separately from its workload resources. In this Scope and role review drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 34

Scenario: A cleanup request could remove shared networking by mistake. In this Scope and role review drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 35

Scenario: A template has hard-coded environment names in several modules. In this Scope and role review drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 36

Scenario: A service team needs to roll back an API-version update. In this Scope and role review drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 37

Scenario: A deployment has a dependency cycle across modules. In this Scope and role review drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 38

Scenario: A template should adopt secure defaults without blocking exceptions. In this Scope and role review drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 39

Scenario: An engineer needs to explain deployment history and correlation IDs. In this Scope and role review drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 40

Scenario: A team is splitting a monolithic template into ownership domains. In this Scope and role review drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 41

Scenario: A release must support both cloud-hosted and private agents. In this Scope and role review drill, the team must define a canary, success signal, abort threshold and rollback owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an annotated change plan and reviewer sign-off. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 42

Scenario: An environment has drift that must be reconciled before deployment. In this Scope and role review drill, the team must separate template-owned resources from existing and shared assets. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a reproducible lab branch and validation transcript. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 43

Scenario: A parameter-file change could expose secrets in source control. In this Scope and role review drill, the team must record module version, lock-down source and artifact provenance. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a decision record with an explicit rejected alternative. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 44

Scenario: A policy assignment blocks an otherwise valid deployment. In this Scope and role review drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a safe recovery checklist with named operational owners. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 45

Scenario: A stack deletion plan might detach or remove production assets. In this Scope and role review drill, the team must compare parameter-file values and prove no secret enters logs. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 46

Scenario: A product team is moving a manually configured web workload into version control. In this Scope and role review drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a set of positive and negative tests for the declared boundary. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 47

Scenario: A regulated payment service needs a separate production boundary. In this Scope and role review drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Architecture clinic 48

Scenario: A platform team is publishing shared modules for dozens of teams. In this Scope and role review drill, the team must identify API-version compatibility and the provider schema contract. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.

Deployment and ownership diagram

Git change → Bicep build / lint → validation → what-if review → scoped identity → ARM deployment → resource provider → activity/deployment evidence

Mark credential boundaries, approval ownership, correlation IDs and safe stop points at each transition.

Change sequence

1. Record desired state and affected owners

2. Build/lint locally and review the diff

3. Run validate and what-if at target scope

4. Approve and deploy in stages

5. Check resources, activity log and workload health

6. Retain evidence and rollback decision

Read-only and local commands

az bicep version
az bicep build --file main.bicep
az bicep lint --file main.bicep
az deployment group validate --resource-group <rg> --template-file main.bicep
az deployment group what-if --resource-group <rg> --template-file main.bicep
az deployment group show --resource-group <rg> --name <deployment-name>

Run az account show first to confirm tenant, subscription and principal. Validate and what-if can perform preflight checks and require read access; create/update commands submit writes. Production deployment requires reviewed authorization and change plan.

Guided lab / 指导实验

Goal: deliver an auditable Bicep change for Scope and role review. (1) Use a sandbox subscription/resource group and confirm caller identity. (2) Copy the sample into a Git branch. (3) express environment differences in parameter files rather than template copies. (4) build, lint and validate. (5) retain what-if output and explain Create/Modify/Delete/NoChange/Ignore line by line. (6) deploy only in the approved lab scope. (7) verify with Azure queries and workload probes. (8) if preview and outcome diverge, stop and retain deployment operations, correlation ID and activity log. Deliver Bicep, sample parameters, preview, verification evidence and rollback note.

Acceptance rubric / 验收标准

Pass only when the template builds, lint findings are dispositioned, parameter and identity boundaries are explicit, what-if has no unexplained destructive change, and deployment output is independently verified.

Production readiness / 生产就绪评审

Scenario: A stack deletion plan might detach or remove production assets. Review the production rollout for Scope and role review. Submit maintenance window, blast radius, change owner, approver, concurrency policy, quota checks, diagnostics/alerts, rollback trigger, data recovery and business communication. Identify template-owned resources versus existing/external dependencies, consequences of delete or detach, and stop gates for API/module upgrade failure.

Failure-mode rehearsal / 故障演练

Run a tabletop for a denied role assignment, provider validation error, partial deployment, unexpected replacement, throttling and a broken health probe. Assign who stops rollout, who gathers evidence, who restores the last known-good declaration and who communicates status.

Evidence-first troubleshooting / 证据优先排错

For a Scope and role review failure, pause retries and automatic promotion. Record commit, CLI/Bicep versions, tenant/subscription/resource group, deployment name and time. Inspect deployment operations, error code, target resource, correlation ID and Activity Log; classify as compiler/type, ARM preflight, RBAC/policy, provider/quota, dependency/runtime or pipeline artifact issue. Preserve raw responses; never use broad permissions, disabled policy or Complete mode as a generic fix.

Knowledge check / 知识检查

Question 1: Scope and role review — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 2: Scope and role review — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 3: Scope and role review — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 4: Scope and role review — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Question 5: Scope and role review — what evidence should an engineer inspect before changing the template?

State scope, intended state, authorization, API version, dependencies, preview and verification; include observable evidence and rollback conditions.

Instructor narration / 讲师讲解提纲

Explain the business value of Scope and role review in five minutes. Ask learners to identify state ownership, then draw inputs, resource graph, authorization path and verification evidence. Have a peer act as change approver and challenge destructive differences, secret handling and rollback ownership. Each learner closes with one verified fact, one assumption and one sandbox-safe validation.

Hour check →

Hour knowledge check / 课时综合检查

1. Describe the ARM deployment lifecycle and explain what Bicep compiles to.

Bicep compiles declarative source to ARM JSON; ARM evaluates the deployment at the declared scope, calls resource providers and records operations.

2. How do parameter types and decorators make an environment contract safer?

Use typed inputs, allowed values and secure decorators where appropriate; keep environment differences in parameter files and review provenance.

3. When is an implicit dependency enough, and when is dependsOn justified?

A symbolic reference creates an implicit dependency when one resource consumes another output; use dependsOn only for ordering without a data reference.

4. What belongs in a reusable module interface and how should its version evolve?

Keep a small typed parameter/output contract, minimize hidden side effects, pin registry versions and document breaking-change migration.

5. How do targetScope, module scope and deployment identity interact?

The root targetScope constrains deployment scope; child modules can target supported scopes, but the caller identity needs permissions at every target.

6. How do you supply secrets without embedding or logging secret values?

Use secure parameters or supported Key Vault parameter references with a least-privilege deployment identity; avoid defaults, outputs and logs containing secrets.

7. What does each of build, lint, validate, what-if and snapshot testing establish?

Build checks compilation, lint checks configured style/security rules, validate runs ARM preflight, what-if predicts change and snapshots compare normalized local representations.

8. How do you gate a federated pipeline and recover from a partial release?

Use workload identity federation, scoped environments, reviewed what-if, canary health gates and a named rollback owner; inspect operations before retrying.

Field checklist / 实战清单

  1. targetScope and deployment functions: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  2. Resource-group scope and existing groups: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  3. Subscription-level resource patterns: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  4. Management-group and tenant deployments: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  5. Cross-scope module orchestration: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  6. Deployment names, location and history: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  7. Platform baseline orchestration lab: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  8. Scope and role review: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.

Official Microsoft Learn references

Check current CLI, Bicep and resource API versions before applying examples.