Core model
Keep secrets out of source and logs, use secure parameter flows and managed identities, and align IaC with Key Vault, RBAC and Azure Policy.
This module uses Azure Policy and secure defaults 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 Azure Policy and secure defaults? 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 policy denies public endpoints but a legacy system depends on one. In this Azure Policy and secure defaults 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 team needs separate owners for subscription and workload resources. In this Azure Policy and secure defaults 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 failed pipeline leaves a partially completed deployment. In this Azure Policy and secure defaults 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 development environment must be safely torn down every sprint. In this Azure Policy and secure defaults 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 production change must pass review before any write operation. In this Azure Policy and secure defaults 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 nested module unexpectedly deploys to the wrong scope. In this Azure Policy and secure defaults 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 template contains a secret copied from a local parameter file. In this Azure Policy and secure defaults 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 release introduces a naming collision in one environment. In this Azure Policy and secure defaults 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 central team wants to enforce diagnostic settings consistently. In this Azure Policy and secure defaults 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 deployment stack may delete resources removed from its template. In this Azure Policy and secure defaults 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 module registry artifact is missing or inaccessible in CI. In this Azure Policy and secure defaults 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 resource is changed manually after a successful deployment. In this Azure Policy and secure defaults 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 what-if report contains many no-change and unsupported lines. In this Azure Policy and secure defaults 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 pipeline needs to deploy to multiple subscriptions with OIDC. In this Azure Policy and secure defaults 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 team is migrating a large ARM JSON template incrementally. In this Azure Policy and secure defaults 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 compliance team needs a time-bounded exception process. In this Azure Policy and secure defaults 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 deployment is close to subscription quota limits. In this Azure Policy and secure defaults 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 shared platform module has no clear deprecation policy. In this Azure Policy and secure defaults 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 stack uses deny settings that could block child resource changes. In this Azure Policy and secure defaults 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 resource is supported only in selected Azure regions. In this Azure Policy and secure defaults 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 must restore a prior configuration after a faulty change. In this Azure Policy and secure defaults 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 deployment uses a Key Vault reference from another subscription. In this Azure Policy and secure defaults 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 module output accidentally exposes a sensitive endpoint token. In this Azure Policy and secure defaults 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 new service needs diagnostic, monitoring, and backup coverage. In this Azure Policy and secure defaults drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.
Architecture clinic 25
Scenario: A team is standardizing tags and resource naming in Bicep. In this Azure Policy and secure defaults 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 pipeline must separate validation credentials from deployment identity. In this Azure Policy and secure defaults 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 management group deployment needs carefully scoped assignments. In this Azure Policy and secure defaults 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 change passes build but fails at provider validation. In this Azure Policy and secure defaults 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: An environment promotion must compare source and target configuration. In this Azure Policy and secure defaults 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 wants to test snapshots without querying live Azure. In this Azure Policy and secure defaults 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 production resource has immutable properties that cannot be replaced. In this Azure Policy and secure defaults 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 module uses experimental features without an upgrade owner. In this Azure Policy and secure defaults 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 cost review asks which resources a template owns. In this Azure Policy and secure defaults 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 team needs an audited emergency deployment path. In this Azure Policy and secure defaults 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 public module dependency changes upstream behavior. In this Azure Policy and secure defaults 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 resource group is created separately from its workload resources. In this Azure Policy and secure defaults 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 cleanup request could remove shared networking by mistake. In this Azure Policy and secure defaults drill, the team must trace the resource dependency graph and name the owning module. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: an evidence bundle with timestamps and correlation identifiers. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.
Architecture clinic 38
Scenario: A template has hard-coded environment names in several modules. In this Azure Policy and secure defaults 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 service team needs to roll back an API-version update. In this Azure Policy and secure defaults 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 deployment has a dependency cycle across modules. In this Azure Policy and secure defaults drill, the team must verify scope and principal permissions before provider preflight. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a stop/go gate tied to measurable workload health. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.
Architecture clinic 41
Scenario: A template should adopt secure defaults without blocking exceptions. In this Azure Policy and secure defaults 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: An engineer needs to explain deployment history and correlation IDs. In this Azure Policy and secure defaults 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 team is splitting a monolithic template into ownership domains. In this Azure Policy and secure defaults 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 release must support both cloud-hosted and private agents. In this Azure Policy and secure defaults 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: An environment has drift that must be reconciled before deployment. In this Azure Policy and secure defaults 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 parameter-file change could expose secrets in source control. In this Azure Policy and secure defaults 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 policy assignment blocks an otherwise valid deployment. In this Azure Policy and secure defaults drill, the team must review what-if replacement/deletion lines against the data owner. Identify affected resources and owners, observable facts, unknown assumptions and user impact on failure. Explain the chosen scope/parameter/module contract, add one counterexample test and a stop condition. Deliverable: a compatibility note for consumers and a version migration plan. A peer reviewer challenges accidental shared-resource deletion, excessive privilege, secret exposure and environment drift.
Architecture clinic 48
Scenario: A stack deletion plan might detach or remove production assets. In this Azure Policy and secure defaults 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.