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

CI/CD, Governance and Production Operations

Deliver Bicep through reviewed pipelines with workload identity federation, scoped service connections, staged promotion, deployment stacks and an operational recovery plan.
BicepAzure Resource ManagerAzure CLIEnglish original · Source of truth for the Chinese translation. Verified against current Microsoft Learn documentation.
Learning outcomes / 学习目标
  • Repository and environment strategy — deliver a reviewed, validated change at the right scope
  • Azure DevOps and GitHub Actions patterns — deliver a reviewed, validated change at the right scope
  • Workload identity federation and credentials — deliver a reviewed, validated change at the right scope
  • What-if approval and staged promotion — deliver a reviewed, validated change at the right scope
  • Deployment stacks and unmanaged resources — deliver a reviewed, validated change at the right scope
  • Drift, history and rollback decisions — deliver a reviewed, validated change at the right scope
  • Production pipeline capstone — deliver a reviewed, validated change at the right scope
  • Change governance and support model — 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
1Repository and environment strategy7
2Azure DevOps and GitHub Actions patterns7
3Workload identity federation and credentials7
4What-if approval and staged promotion7
5Deployment stacks and unmanaged resources7
6Drift, history and rollback decisions7
7Production pipeline capstone7
8Change governance and support model7

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.

Repository and environment strategy

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

Core model

Deliver Bicep through reviewed pipelines with workload identity federation, scoped service connections, staged promotion, deployment stacks and an operational recovery plan.

This module uses Repository and environment strategy 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 Repository and environment strategy? 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 regulated payment service needs a separate production boundary. In this Repository and environment strategy 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: A platform team is publishing shared modules for dozens of teams. In this Repository and environment strategy 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: An acquisition introduces existing subscriptions and naming rules. In this Repository and environment strategy 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 deployment must preserve an existing database and its data. In this Repository and environment strategy 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 pipeline currently uses a long-lived service-principal secret. In this Repository and environment strategy 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 regional rollout needs consistent network and policy baselines. In this Repository and environment strategy 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 deployment preview shows unexpected resource replacement. In this Repository and environment strategy 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 team needs per-environment values without copying templates. In this Repository and environment strategy 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: A resource provider API version changes its required property shape. In this Repository and environment strategy 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: An auditor needs reproducible evidence for each infrastructure change. In this Repository and environment strategy 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 shared module has breaking changes planned for a new release. In this Repository and environment strategy 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 policy denies public endpoints but a legacy system depends on one. In this Repository and environment strategy 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 team needs separate owners for subscription and workload resources. In this Repository and environment strategy 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 failed pipeline leaves a partially completed deployment. In this Repository and environment strategy 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 development environment must be safely torn down every sprint. In this Repository and environment strategy 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: A production change must pass review before any write operation. In this Repository and environment strategy 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 nested module unexpectedly deploys to the wrong scope. In this Repository and environment strategy 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 template contains a secret copied from a local parameter file. In this Repository and environment strategy 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 release introduces a naming collision in one environment. In this Repository and environment strategy 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 central team wants to enforce diagnostic settings consistently. In this Repository and environment strategy 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 deployment stack may delete resources removed from its template. In this Repository and environment strategy 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 module registry artifact is missing or inaccessible in CI. In this Repository and environment strategy 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 resource is changed manually after a successful deployment. In this Repository and environment strategy 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 what-if report contains many no-change and unsupported lines. In this Repository and environment strategy 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 pipeline needs to deploy to multiple subscriptions with OIDC. In this Repository and environment strategy 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 team is migrating a large ARM JSON template incrementally. In this Repository and environment strategy 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 compliance team needs a time-bounded exception process. In this Repository and environment strategy 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 deployment is close to subscription quota limits. In this Repository and environment strategy 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 shared platform module has no clear deprecation policy. In this Repository and environment strategy 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 stack uses deny settings that could block child resource changes. In this Repository and environment strategy 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 resource is supported only in selected Azure regions. In this Repository and environment strategy 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 must restore a prior configuration after a faulty change. In this Repository and environment strategy 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 deployment uses a Key Vault reference from another subscription. In this Repository and environment strategy 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 module output accidentally exposes a sensitive endpoint token. In this Repository and environment strategy 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 new service needs diagnostic, monitoring, and backup coverage. In this Repository and environment strategy 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 team is standardizing tags and resource naming in Bicep. In this Repository and environment strategy 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 pipeline must separate validation credentials from deployment identity. In this Repository and environment strategy 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 management group deployment needs carefully scoped assignments. In this Repository and environment strategy 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 module change passes build but fails at provider validation. In this Repository and environment strategy 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: An environment promotion must compare source and target configuration. In this Repository and environment strategy 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 team wants to test snapshots without querying live Azure. In this Repository and environment strategy 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 production resource has immutable properties that cannot be replaced. In this Repository and environment strategy 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 module uses experimental features without an upgrade owner. In this Repository and environment strategy 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 cost review asks which resources a template owns. In this Repository and environment strategy 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 team needs an audited emergency deployment path. In this Repository and environment strategy 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: A public module dependency changes upstream behavior. In this Repository and environment strategy 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 resource group is created separately from its workload resources. In this Repository and environment strategy 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 cleanup request could remove shared networking by mistake. In this Repository and environment strategy 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 Repository and environment strategy. (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 Repository and environment strategy. 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 Repository and environment strategy 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: Repository and environment strategy — 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: Repository and environment strategy — 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: Repository and environment strategy — 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: Repository and environment strategy — 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: Repository and environment strategy — 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 Repository and environment strategy 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 →

Azure DevOps and GitHub Actions patterns

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

Core model

Deliver Bicep through reviewed pipelines with workload identity federation, scoped service connections, staged promotion, deployment stacks and an operational recovery plan.

This module uses Azure DevOps and GitHub Actions 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 = 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 Azure DevOps and GitHub Actions 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 regional rollout needs consistent network and policy baselines. In this Azure DevOps and GitHub Actions 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: 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 preview shows unexpected resource replacement. In this Azure DevOps and GitHub Actions 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 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 team needs per-environment values without copying templates. In this Azure DevOps and GitHub Actions 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: 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 resource provider API version changes its required property shape. In this Azure DevOps and GitHub Actions 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 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: An auditor needs reproducible evidence for each infrastructure change. In this Azure DevOps and GitHub Actions 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: 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 shared module has breaking changes planned for a new release. In this Azure DevOps and GitHub Actions 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 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 policy denies public endpoints but a legacy system depends on one. In this Azure DevOps and GitHub Actions 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: 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 team needs separate owners for subscription and workload resources. In this Azure DevOps and GitHub Actions 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 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 failed pipeline leaves a partially completed deployment. In this Azure DevOps and GitHub Actions 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: 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 development environment must be safely torn down every sprint. In this Azure DevOps and GitHub Actions 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 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 production change must pass review before any write operation. In this Azure DevOps and GitHub Actions 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: 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 nested module unexpectedly deploys to the wrong scope. In this Azure DevOps and GitHub Actions 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 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 contains a secret copied from a local parameter file. In this Azure DevOps and GitHub Actions 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: 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 release introduces a naming collision in one environment. In this Azure DevOps and GitHub Actions 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 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 central team wants to enforce diagnostic settings consistently. In this Azure DevOps and GitHub Actions 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: 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 deployment stack may delete resources removed from its template. In this Azure DevOps and GitHub Actions 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 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 module registry artifact is missing or inaccessible in CI. In this Azure DevOps and GitHub Actions 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: 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 resource is changed manually after a successful deployment. In this Azure DevOps and GitHub Actions 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 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 what-if report contains many no-change and unsupported lines. In this Azure DevOps and GitHub Actions 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: 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 pipeline needs to deploy to multiple subscriptions with OIDC. In this Azure DevOps and GitHub Actions 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 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 team is migrating a large ARM JSON template incrementally. In this Azure DevOps and GitHub Actions 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: 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 compliance team needs a time-bounded exception process. In this Azure DevOps and GitHub Actions 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 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 is close to subscription quota limits. In this Azure DevOps and GitHub Actions 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: 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 shared platform module has no clear deprecation policy. In this Azure DevOps and GitHub Actions 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 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 stack uses deny settings that could block child resource changes. In this Azure DevOps and GitHub Actions 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: 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 resource is supported only in selected Azure regions. In this Azure DevOps and GitHub Actions 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 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 must restore a prior configuration after a faulty change. In this Azure DevOps and GitHub Actions 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: 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 uses a Key Vault reference from another subscription. In this Azure DevOps and GitHub Actions 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 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 output accidentally exposes a sensitive endpoint token. In this Azure DevOps and GitHub Actions 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: 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 new service needs diagnostic, monitoring, and backup coverage. In this Azure DevOps and GitHub Actions 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 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 is standardizing tags and resource naming in Bicep. In this Azure DevOps and GitHub Actions 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: 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 pipeline must separate validation credentials from deployment identity. In this Azure DevOps and GitHub Actions 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 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 management group deployment needs carefully scoped assignments. In this Azure DevOps and GitHub Actions 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: 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 change passes build but fails at provider validation. In this Azure DevOps and GitHub Actions 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 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: An environment promotion must compare source and target configuration. In this Azure DevOps and GitHub Actions 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: 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 wants to test snapshots without querying live Azure. In this Azure DevOps and GitHub Actions 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 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 resource has immutable properties that cannot be replaced. In this Azure DevOps and GitHub Actions 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: 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 uses experimental features without an upgrade owner. In this Azure DevOps and GitHub Actions 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 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 cost review asks which resources a template owns. In this Azure DevOps and GitHub Actions 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: 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 needs an audited emergency deployment path. In this Azure DevOps and GitHub Actions 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 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 public module dependency changes upstream behavior. In this Azure DevOps and GitHub Actions 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: 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 group is created separately from its workload resources. In this Azure DevOps and GitHub Actions 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 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 cleanup request could remove shared networking by mistake. In this Azure DevOps and GitHub Actions 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: 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 template has hard-coded environment names in several modules. In this Azure DevOps and GitHub Actions 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 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 service team needs to roll back an API-version update. In this Azure DevOps and GitHub Actions 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: 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 deployment has a dependency cycle across modules. In this Azure DevOps and GitHub Actions 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 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 template should adopt secure defaults without blocking exceptions. In this Azure DevOps and GitHub Actions 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: 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: An engineer needs to explain deployment history and correlation IDs. In this Azure DevOps and GitHub Actions 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 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 Azure DevOps and GitHub Actions 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 platform team is publishing shared modules for dozens of teams. Review the production rollout for Azure DevOps and GitHub Actions 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 Azure DevOps and GitHub Actions 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: Azure DevOps and GitHub Actions 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: Azure DevOps and GitHub Actions 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: Azure DevOps and GitHub Actions 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: Azure DevOps and GitHub Actions 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: Azure DevOps and GitHub Actions 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 Azure DevOps and GitHub Actions 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 →

Workload identity federation and credentials

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

Core model

Deliver Bicep through reviewed pipelines with workload identity federation, scoped service connections, staged promotion, deployment stacks and an operational recovery plan.

This module uses Workload identity federation and credentials 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 Workload identity federation and credentials? 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 shared module has breaking changes planned for a new release. In this Workload identity federation and credentials 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 policy denies public endpoints but a legacy system depends on one. In this Workload identity federation and credentials 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 team needs separate owners for subscription and workload resources. In this Workload identity federation and credentials 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 failed pipeline leaves a partially completed deployment. In this Workload identity federation and credentials 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 development environment must be safely torn down every sprint. In this Workload identity federation and credentials 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: A production change must pass review before any write operation. In this Workload identity federation and credentials 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 nested module unexpectedly deploys to the wrong scope. In this Workload identity federation and credentials 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 template contains a secret copied from a local parameter file. In this Workload identity federation and credentials 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 release introduces a naming collision in one environment. In this Workload identity federation and credentials 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 central team wants to enforce diagnostic settings consistently. In this Workload identity federation and credentials 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 deployment stack may delete resources removed from its template. In this Workload identity federation and credentials 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 module registry artifact is missing or inaccessible in CI. In this Workload identity federation and credentials 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 resource is changed manually after a successful deployment. In this Workload identity federation and credentials 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 what-if report contains many no-change and unsupported lines. In this Workload identity federation and credentials 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 pipeline needs to deploy to multiple subscriptions with OIDC. In this Workload identity federation and credentials 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 team is migrating a large ARM JSON template incrementally. In this Workload identity federation and credentials 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 compliance team needs a time-bounded exception process. In this Workload identity federation and credentials 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 deployment is close to subscription quota limits. In this Workload identity federation and credentials 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 shared platform module has no clear deprecation policy. In this Workload identity federation and credentials 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 stack uses deny settings that could block child resource changes. In this Workload identity federation and credentials 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 resource is supported only in selected Azure regions. In this Workload identity federation and credentials 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 must restore a prior configuration after a faulty change. In this Workload identity federation and credentials 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 deployment uses a Key Vault reference from another subscription. In this Workload identity federation and credentials 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 module output accidentally exposes a sensitive endpoint token. In this Workload identity federation and credentials 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 new service needs diagnostic, monitoring, and backup coverage. In this Workload identity federation and credentials 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 team is standardizing tags and resource naming in Bicep. In this Workload identity federation and credentials 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 pipeline must separate validation credentials from deployment identity. In this Workload identity federation and credentials 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 management group deployment needs carefully scoped assignments. In this Workload identity federation and credentials 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 module change passes build but fails at provider validation. In this Workload identity federation and credentials 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: An environment promotion must compare source and target configuration. In this Workload identity federation and credentials 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 team wants to test snapshots without querying live Azure. In this Workload identity federation and credentials 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 production resource has immutable properties that cannot be replaced. In this Workload identity federation and credentials 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 module uses experimental features without an upgrade owner. In this Workload identity federation and credentials 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 cost review asks which resources a template owns. In this Workload identity federation and credentials 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 team needs an audited emergency deployment path. In this Workload identity federation and credentials 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: A public module dependency changes upstream behavior. In this Workload identity federation and credentials 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 resource group is created separately from its workload resources. In this Workload identity federation and credentials 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 cleanup request could remove shared networking by mistake. In this Workload identity federation and credentials 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 template has hard-coded environment names in several modules. In this Workload identity federation and credentials 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 service team needs to roll back an API-version update. In this Workload identity federation and credentials 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 deployment has a dependency cycle across modules. In this Workload identity federation and credentials 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 template should adopt secure defaults without blocking exceptions. In this Workload identity federation and credentials 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: An engineer needs to explain deployment history and correlation IDs. In this Workload identity federation and credentials 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 team is splitting a monolithic template into ownership domains. In this Workload identity federation and credentials 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 release must support both cloud-hosted and private agents. In this Workload identity federation and credentials 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: An environment has drift that must be reconciled before deployment. In this Workload identity federation and credentials 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 parameter-file change could expose secrets in source control. In this Workload identity federation and credentials 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 policy assignment blocks an otherwise valid deployment. In this Workload identity federation and credentials 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 Workload identity federation and credentials. (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 pipeline currently uses a long-lived service-principal secret. Review the production rollout for Workload identity federation and credentials. 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 Workload identity federation and credentials 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: Workload identity federation and credentials — 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: Workload identity federation and credentials — 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: Workload identity federation and credentials — 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: Workload identity federation and credentials — 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: Workload identity federation and credentials — 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 Workload identity federation and credentials 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 →

What-if approval and staged promotion

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

Core model

Deliver Bicep through reviewed pipelines with workload identity federation, scoped service connections, staged promotion, deployment stacks and an operational recovery plan.

This module uses What-if approval and staged promotion 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 What-if approval and staged promotion? 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 production change must pass review before any write operation. In this What-if approval and staged promotion 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 nested module unexpectedly deploys to the wrong scope. In this What-if approval and staged promotion 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 template contains a secret copied from a local parameter file. In this What-if approval and staged promotion 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 release introduces a naming collision in one environment. In this What-if approval and staged promotion 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 central team wants to enforce diagnostic settings consistently. In this What-if approval and staged promotion 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 deployment stack may delete resources removed from its template. In this What-if approval and staged promotion 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 module registry artifact is missing or inaccessible in CI. In this What-if approval and staged promotion 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 resource is changed manually after a successful deployment. In this What-if approval and staged promotion 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 what-if report contains many no-change and unsupported lines. In this What-if approval and staged promotion 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 pipeline needs to deploy to multiple subscriptions with OIDC. In this What-if approval and staged promotion 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 team is migrating a large ARM JSON template incrementally. In this What-if approval and staged promotion 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 compliance team needs a time-bounded exception process. In this What-if approval and staged promotion 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 deployment is close to subscription quota limits. In this What-if approval and staged promotion 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 shared platform module has no clear deprecation policy. In this What-if approval and staged promotion 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 stack uses deny settings that could block child resource changes. In this What-if approval and staged promotion 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 resource is supported only in selected Azure regions. In this What-if approval and staged promotion 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 must restore a prior configuration after a faulty change. In this What-if approval and staged promotion 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 deployment uses a Key Vault reference from another subscription. In this What-if approval and staged promotion 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 module output accidentally exposes a sensitive endpoint token. In this What-if approval and staged promotion 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 new service needs diagnostic, monitoring, and backup coverage. In this What-if approval and staged promotion 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 team is standardizing tags and resource naming in Bicep. In this What-if approval and staged promotion 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 pipeline must separate validation credentials from deployment identity. In this What-if approval and staged promotion 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 management group deployment needs carefully scoped assignments. In this What-if approval and staged promotion 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 module change passes build but fails at provider validation. In this What-if approval and staged promotion 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: An environment promotion must compare source and target configuration. In this What-if approval and staged promotion 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 team wants to test snapshots without querying live Azure. In this What-if approval and staged promotion 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 production resource has immutable properties that cannot be replaced. In this What-if approval and staged promotion 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 module uses experimental features without an upgrade owner. In this What-if approval and staged promotion 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 cost review asks which resources a template owns. In this What-if approval and staged promotion 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 team needs an audited emergency deployment path. In this What-if approval and staged promotion 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: A public module dependency changes upstream behavior. In this What-if approval and staged promotion 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 resource group is created separately from its workload resources. In this What-if approval and staged promotion 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 cleanup request could remove shared networking by mistake. In this What-if approval and staged promotion 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 template has hard-coded environment names in several modules. In this What-if approval and staged promotion 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 service team needs to roll back an API-version update. In this What-if approval and staged promotion 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 deployment has a dependency cycle across modules. In this What-if approval and staged promotion 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 template should adopt secure defaults without blocking exceptions. In this What-if approval and staged promotion 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: An engineer needs to explain deployment history and correlation IDs. In this What-if approval and staged promotion 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 team is splitting a monolithic template into ownership domains. In this What-if approval and staged promotion 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 release must support both cloud-hosted and private agents. In this What-if approval and staged promotion 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: An environment has drift that must be reconciled before deployment. In this What-if approval and staged promotion 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 parameter-file change could expose secrets in source control. In this What-if approval and staged promotion 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 policy assignment blocks an otherwise valid deployment. In this What-if approval and staged promotion 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: A stack deletion plan might detach or remove production assets. In this What-if approval and staged promotion 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 product team is moving a manually configured web workload into version control. In this What-if approval and staged promotion 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 regulated payment service needs a separate production boundary. In this What-if approval and staged promotion 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: A platform team is publishing shared modules for dozens of teams. In this What-if approval and staged promotion 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: An acquisition introduces existing subscriptions and naming rules. In this What-if approval and staged promotion 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 What-if approval and staged promotion. (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 needs per-environment values without copying templates. Review the production rollout for What-if approval and staged promotion. 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 What-if approval and staged promotion 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: What-if approval and staged promotion — 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: What-if approval and staged promotion — 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: What-if approval and staged promotion — 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: What-if approval and staged promotion — 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: What-if approval and staged promotion — 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 What-if approval and staged promotion 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 stacks and unmanaged resources

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

Core model

Deliver Bicep through reviewed pipelines with workload identity federation, scoped service connections, staged promotion, deployment stacks and an operational recovery plan.

This module uses Deployment stacks and unmanaged resources 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 Deployment stacks and unmanaged resources? 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 deployment stack may delete resources removed from its template. In this Deployment stacks and unmanaged resources 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 module registry artifact is missing or inaccessible in CI. In this Deployment stacks and unmanaged resources 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 resource is changed manually after a successful deployment. In this Deployment stacks and unmanaged resources 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 what-if report contains many no-change and unsupported lines. In this Deployment stacks and unmanaged resources 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 pipeline needs to deploy to multiple subscriptions with OIDC. In this Deployment stacks and unmanaged resources 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 team is migrating a large ARM JSON template incrementally. In this Deployment stacks and unmanaged resources 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 compliance team needs a time-bounded exception process. In this Deployment stacks and unmanaged resources 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 deployment is close to subscription quota limits. In this Deployment stacks and unmanaged resources 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 shared platform module has no clear deprecation policy. In this Deployment stacks and unmanaged resources 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 stack uses deny settings that could block child resource changes. In this Deployment stacks and unmanaged resources 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 resource is supported only in selected Azure regions. In this Deployment stacks and unmanaged resources 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 must restore a prior configuration after a faulty change. In this Deployment stacks and unmanaged resources 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 deployment uses a Key Vault reference from another subscription. In this Deployment stacks and unmanaged resources 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 module output accidentally exposes a sensitive endpoint token. In this Deployment stacks and unmanaged resources 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 new service needs diagnostic, monitoring, and backup coverage. In this Deployment stacks and unmanaged resources 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 team is standardizing tags and resource naming in Bicep. In this Deployment stacks and unmanaged resources 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 pipeline must separate validation credentials from deployment identity. In this Deployment stacks and unmanaged resources 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 management group deployment needs carefully scoped assignments. In this Deployment stacks and unmanaged resources 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 module change passes build but fails at provider validation. In this Deployment stacks and unmanaged resources 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: An environment promotion must compare source and target configuration. In this Deployment stacks and unmanaged resources 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 team wants to test snapshots without querying live Azure. In this Deployment stacks and unmanaged resources 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 production resource has immutable properties that cannot be replaced. In this Deployment stacks and unmanaged resources 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 module uses experimental features without an upgrade owner. In this Deployment stacks and unmanaged resources 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 cost review asks which resources a template owns. In this Deployment stacks and unmanaged resources 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 team needs an audited emergency deployment path. In this Deployment stacks and unmanaged resources 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: A public module dependency changes upstream behavior. In this Deployment stacks and unmanaged resources 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 resource group is created separately from its workload resources. In this Deployment stacks and unmanaged resources 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 cleanup request could remove shared networking by mistake. In this Deployment stacks and unmanaged resources 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 template has hard-coded environment names in several modules. In this Deployment stacks and unmanaged resources 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 service team needs to roll back an API-version update. In this Deployment stacks and unmanaged resources 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 deployment has a dependency cycle across modules. In this Deployment stacks and unmanaged resources 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 template should adopt secure defaults without blocking exceptions. In this Deployment stacks and unmanaged resources 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: An engineer needs to explain deployment history and correlation IDs. In this Deployment stacks and unmanaged resources 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 team is splitting a monolithic template into ownership domains. In this Deployment stacks and unmanaged resources 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 release must support both cloud-hosted and private agents. In this Deployment stacks and unmanaged resources 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: An environment has drift that must be reconciled before deployment. In this Deployment stacks and unmanaged resources 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 parameter-file change could expose secrets in source control. In this Deployment stacks and unmanaged resources 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 policy assignment blocks an otherwise valid deployment. In this Deployment stacks and unmanaged resources 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: A stack deletion plan might detach or remove production assets. In this Deployment stacks and unmanaged resources 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 product team is moving a manually configured web workload into version control. In this Deployment stacks and unmanaged resources 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 regulated payment service needs a separate production boundary. In this Deployment stacks and unmanaged resources 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: A platform team is publishing shared modules for dozens of teams. In this Deployment stacks and unmanaged resources 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: An acquisition introduces existing subscriptions and naming rules. In this Deployment stacks and unmanaged resources 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 deployment must preserve an existing database and its data. In this Deployment stacks and unmanaged resources 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 pipeline currently uses a long-lived service-principal secret. In this Deployment stacks and unmanaged resources 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 regional rollout needs consistent network and policy baselines. In this Deployment stacks and unmanaged resources 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 deployment preview shows unexpected resource replacement. In this Deployment stacks and unmanaged resources 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 team needs per-environment values without copying templates. In this Deployment stacks and unmanaged resources 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 Deployment stacks and unmanaged resources. (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 shared module has breaking changes planned for a new release. Review the production rollout for Deployment stacks and unmanaged resources. 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 stacks and unmanaged resources 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 stacks and unmanaged resources — 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 stacks and unmanaged resources — 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 stacks and unmanaged resources — 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 stacks and unmanaged resources — 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 stacks and unmanaged resources — 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 stacks and unmanaged resources 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 →

Drift, history and rollback decisions

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

Core model

Deliver Bicep through reviewed pipelines with workload identity federation, scoped service connections, staged promotion, deployment stacks and an operational recovery plan.

This module uses Drift, history and rollback decisions 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 Drift, history and rollback decisions? 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 is migrating a large ARM JSON template incrementally. In this Drift, history and rollback decisions 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 compliance team needs a time-bounded exception process. In this Drift, history and rollback decisions 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 deployment is close to subscription quota limits. In this Drift, history and rollback decisions 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 shared platform module has no clear deprecation policy. In this Drift, history and rollback decisions 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 stack uses deny settings that could block child resource changes. In this Drift, history and rollback decisions 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 resource is supported only in selected Azure regions. In this Drift, history and rollback decisions 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 team must restore a prior configuration after a faulty change. In this Drift, history and rollback decisions 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 deployment uses a Key Vault reference from another subscription. In this Drift, history and rollback decisions 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 module output accidentally exposes a sensitive endpoint token. In this Drift, history and rollback decisions 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 new service needs diagnostic, monitoring, and backup coverage. In this Drift, history and rollback decisions 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 team is standardizing tags and resource naming in Bicep. In this Drift, history and rollback decisions 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 pipeline must separate validation credentials from deployment identity. In this Drift, history and rollback decisions 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 management group deployment needs carefully scoped assignments. In this Drift, history and rollback decisions 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: A module change passes build but fails at provider validation. In this Drift, history and rollback decisions 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: An environment promotion must compare source and target configuration. In this Drift, history and rollback decisions 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 team wants to test snapshots without querying live Azure. In this Drift, history and rollback decisions 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: A production resource has immutable properties that cannot be replaced. In this Drift, history and rollback decisions 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 module uses experimental features without an upgrade owner. In this Drift, history and rollback decisions 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 cost review asks which resources a template owns. In this Drift, history and rollback decisions 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 team needs an audited emergency deployment path. In this Drift, history and rollback decisions 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 public module dependency changes upstream behavior. In this Drift, history and rollback decisions 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 resource group is created separately from its workload resources. In this Drift, history and rollback decisions 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 cleanup request could remove shared networking by mistake. In this Drift, history and rollback decisions 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: A template has hard-coded environment names in several modules. In this Drift, history and rollback decisions 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 service team needs to roll back an API-version update. In this Drift, history and rollback decisions 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 deployment has a dependency cycle across modules. In this Drift, history and rollback decisions 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 template should adopt secure defaults without blocking exceptions. In this Drift, history and rollback decisions 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: An engineer needs to explain deployment history and correlation IDs. In this Drift, history and rollback decisions 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 is splitting a monolithic template into ownership domains. In this Drift, history and rollback decisions 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 release must support both cloud-hosted and private agents. In this Drift, history and rollback decisions 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 environment has drift that must be reconciled before deployment. In this Drift, history and rollback decisions 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 parameter-file change could expose secrets in source control. In this Drift, history and rollback decisions 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 assignment blocks an otherwise valid deployment. In this Drift, history and rollback decisions 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 stack deletion plan might detach or remove production assets. In this Drift, history and rollback decisions 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 product team is moving a manually configured web workload into version control. In this Drift, history and rollback decisions 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 regulated payment service needs a separate production boundary. In this Drift, history and rollback decisions 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 platform team is publishing shared modules for dozens of teams. In this Drift, history and rollback decisions 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: An acquisition introduces existing subscriptions and naming rules. In this Drift, history and rollback decisions 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 deployment must preserve an existing database and its data. In this Drift, history and rollback decisions 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 pipeline currently uses a long-lived service-principal secret. In this Drift, history and rollback decisions 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 regional rollout needs consistent network and policy baselines. In this Drift, history and rollback decisions 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 preview shows unexpected resource replacement. In this Drift, history and rollback decisions 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 team needs per-environment values without copying templates. In this Drift, history and rollback decisions 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 provider API version changes its required property shape. In this Drift, history and rollback decisions 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: An auditor needs reproducible evidence for each infrastructure change. In this Drift, history and rollback decisions 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 shared module has breaking changes planned for a new release. In this Drift, history and rollback decisions 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 policy denies public endpoints but a legacy system depends on one. In this Drift, history and rollback decisions 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 team needs separate owners for subscription and workload resources. In this Drift, history and rollback decisions 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 Drift, history and rollback decisions. (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 failed pipeline leaves a partially completed deployment. Review the production rollout for Drift, history and rollback decisions. 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 Drift, history and rollback decisions 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: Drift, history and rollback decisions — 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: Drift, history and rollback decisions — 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: Drift, history and rollback decisions — 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: Drift, history and rollback decisions — 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: Drift, history and rollback decisions — 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 Drift, history and rollback decisions 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 →

Production pipeline capstone

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

Core model

Deliver Bicep through reviewed pipelines with workload identity federation, scoped service connections, staged promotion, deployment stacks and an operational recovery plan.

This module uses Production pipeline capstone 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 Production pipeline capstone? 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 resource is supported only in selected Azure regions. In this Production pipeline capstone 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 team must restore a prior configuration after a faulty change. In this Production pipeline capstone 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 deployment uses a Key Vault reference from another subscription. In this Production pipeline capstone 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 module output accidentally exposes a sensitive endpoint token. In this Production pipeline capstone 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 new service needs diagnostic, monitoring, and backup coverage. In this Production pipeline capstone 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 team is standardizing tags and resource naming in Bicep. In this Production pipeline capstone 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 pipeline must separate validation credentials from deployment identity. In this Production pipeline capstone 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 management group deployment needs carefully scoped assignments. In this Production pipeline capstone 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: A module change passes build but fails at provider validation. In this Production pipeline capstone 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: An environment promotion must compare source and target configuration. In this Production pipeline capstone 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 team wants to test snapshots without querying live Azure. In this Production pipeline capstone 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: A production resource has immutable properties that cannot be replaced. In this Production pipeline capstone 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 module uses experimental features without an upgrade owner. In this Production pipeline capstone 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 cost review asks which resources a template owns. In this Production pipeline capstone 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 team needs an audited emergency deployment path. In this Production pipeline capstone 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 public module dependency changes upstream behavior. In this Production pipeline capstone 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 resource group is created separately from its workload resources. In this Production pipeline capstone 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 cleanup request could remove shared networking by mistake. In this Production pipeline capstone 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: A template has hard-coded environment names in several modules. In this Production pipeline capstone 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 service team needs to roll back an API-version update. In this Production pipeline capstone 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 deployment has a dependency cycle across modules. In this Production pipeline capstone 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 template should adopt secure defaults without blocking exceptions. In this Production pipeline capstone 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: An engineer needs to explain deployment history and correlation IDs. In this Production pipeline capstone 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 is splitting a monolithic template into ownership domains. In this Production pipeline capstone 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 release must support both cloud-hosted and private agents. In this Production pipeline capstone 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 environment has drift that must be reconciled before deployment. In this Production pipeline capstone 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 parameter-file change could expose secrets in source control. In this Production pipeline capstone 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 assignment blocks an otherwise valid deployment. In this Production pipeline capstone 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 stack deletion plan might detach or remove production assets. In this Production pipeline capstone 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 product team is moving a manually configured web workload into version control. In this Production pipeline capstone 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 regulated payment service needs a separate production boundary. In this Production pipeline capstone 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 platform team is publishing shared modules for dozens of teams. In this Production pipeline capstone 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: An acquisition introduces existing subscriptions and naming rules. In this Production pipeline capstone 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 deployment must preserve an existing database and its data. In this Production pipeline capstone 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 pipeline currently uses a long-lived service-principal secret. In this Production pipeline capstone 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 regional rollout needs consistent network and policy baselines. In this Production pipeline capstone 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 preview shows unexpected resource replacement. In this Production pipeline capstone 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 team needs per-environment values without copying templates. In this Production pipeline capstone 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 provider API version changes its required property shape. In this Production pipeline capstone 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: An auditor needs reproducible evidence for each infrastructure change. In this Production pipeline capstone 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 shared module has breaking changes planned for a new release. In this Production pipeline capstone 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 policy denies public endpoints but a legacy system depends on one. In this Production pipeline capstone 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 team needs separate owners for subscription and workload resources. In this Production pipeline capstone 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 failed pipeline leaves a partially completed deployment. In this Production pipeline capstone 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 development environment must be safely torn down every sprint. In this Production pipeline capstone 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 production change must pass review before any write operation. In this Production pipeline capstone 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 nested module unexpectedly deploys to the wrong scope. In this Production pipeline capstone 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 template contains a secret copied from a local parameter file. In this Production pipeline capstone 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 Production pipeline capstone. (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 nested module unexpectedly deploys to the wrong scope. Review the production rollout for Production pipeline capstone. 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 Production pipeline capstone 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: Production pipeline capstone — 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: Production pipeline capstone — 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: Production pipeline capstone — 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: Production pipeline capstone — 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: Production pipeline capstone — 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 Production pipeline capstone 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 →

Change governance and support model

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

Core model

Deliver Bicep through reviewed pipelines with workload identity federation, scoped service connections, staged promotion, deployment stacks and an operational recovery plan.

This module uses Change governance and support model 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 Change governance and support model? 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 is standardizing tags and resource naming in Bicep. In this Change governance and support model 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 pipeline must separate validation credentials from deployment identity. In this Change governance and support model 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 management group deployment needs carefully scoped assignments. In this Change governance and support model 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: A module change passes build but fails at provider validation. In this Change governance and support model 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: An environment promotion must compare source and target configuration. In this Change governance and support model 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 team wants to test snapshots without querying live Azure. In this Change governance and support model 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: A production resource has immutable properties that cannot be replaced. In this Change governance and support model 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 module uses experimental features without an upgrade owner. In this Change governance and support model 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 cost review asks which resources a template owns. In this Change governance and support model 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 team needs an audited emergency deployment path. In this Change governance and support model 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 public module dependency changes upstream behavior. In this Change governance and support model 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 resource group is created separately from its workload resources. In this Change governance and support model 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 cleanup request could remove shared networking by mistake. In this Change governance and support model 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: A template has hard-coded environment names in several modules. In this Change governance and support model 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 service team needs to roll back an API-version update. In this Change governance and support model 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 deployment has a dependency cycle across modules. In this Change governance and support model 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 template should adopt secure defaults without blocking exceptions. In this Change governance and support model 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: An engineer needs to explain deployment history and correlation IDs. In this Change governance and support model 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 is splitting a monolithic template into ownership domains. In this Change governance and support model 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 release must support both cloud-hosted and private agents. In this Change governance and support model 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 environment has drift that must be reconciled before deployment. In this Change governance and support model 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 parameter-file change could expose secrets in source control. In this Change governance and support model 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 assignment blocks an otherwise valid deployment. In this Change governance and support model 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 stack deletion plan might detach or remove production assets. In this Change governance and support model 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 product team is moving a manually configured web workload into version control. In this Change governance and support model 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 regulated payment service needs a separate production boundary. In this Change governance and support model 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 platform team is publishing shared modules for dozens of teams. In this Change governance and support model 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: An acquisition introduces existing subscriptions and naming rules. In this Change governance and support model 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 deployment must preserve an existing database and its data. In this Change governance and support model 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 pipeline currently uses a long-lived service-principal secret. In this Change governance and support model 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 regional rollout needs consistent network and policy baselines. In this Change governance and support model 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 preview shows unexpected resource replacement. In this Change governance and support model 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 team needs per-environment values without copying templates. In this Change governance and support model 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 provider API version changes its required property shape. In this Change governance and support model 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: An auditor needs reproducible evidence for each infrastructure change. In this Change governance and support model 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 shared module has breaking changes planned for a new release. In this Change governance and support model 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 policy denies public endpoints but a legacy system depends on one. In this Change governance and support model 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 team needs separate owners for subscription and workload resources. In this Change governance and support model 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 failed pipeline leaves a partially completed deployment. In this Change governance and support model 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 development environment must be safely torn down every sprint. In this Change governance and support model 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 production change must pass review before any write operation. In this Change governance and support model 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 nested module unexpectedly deploys to the wrong scope. In this Change governance and support model 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 template contains a secret copied from a local parameter file. In this Change governance and support model 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 release introduces a naming collision in one environment. In this Change governance and support model 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 central team wants to enforce diagnostic settings consistently. In this Change governance and support model 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 deployment stack may delete resources removed from its template. In this Change governance and support model 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 module registry artifact is missing or inaccessible in CI. In this Change governance and support model 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 resource is changed manually after a successful deployment. In this Change governance and support model 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 Change governance and support model. (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 central team wants to enforce diagnostic settings consistently. Review the production rollout for Change governance and support model. 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 Change governance and support model 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: Change governance and support model — 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: Change governance and support model — 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: Change governance and support model — 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: Change governance and support model — 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: Change governance and support model — 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 Change governance and support model 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. Repository and environment strategy: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  2. Azure DevOps and GitHub Actions patterns: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  3. Workload identity federation and credentials: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  4. What-if approval and staged promotion: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  5. Deployment stacks and unmanaged resources: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  6. Drift, history and rollback decisions: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  7. Production pipeline capstone: build, lint, review scope, validate, inspect what-if, deploy only after approval, verify and retain evidence.
  8. Change governance and support model: 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.