Skill 30 · Azure Enterprise Infra Planner
Subchapter 30.23
references/referenced-workload.mdMarkdown7 KBView on GitHub
Read this when the user provides something that already EXISTS — a live Azure resource / resource group / subscription, IaC (Bicep/Terraform/ARM) or an infra plan, or a general doc describing current infrastructure/requirements. If the input is purely NEW requirements with nothing existing, it’s greenfield — ignore this file and run the normal phases.
az resource list / az graph query) → real
resources with resource IDs.infrastructure-plan.json, terraform show -json) →
parse resource / existing / data blocks → logical resources.existing / data, real ID for live, a param otherwise) and wire the new
resources to them, honoring the gathered insights. Never emit a new resource for something that
already exists.Open with a plain-language summary of the existing infrastructure you inventoried and the additive change you understood, then an explicit confirmation checkpoint (“Confirm this understanding before I proceed to deploy”), and then generate the complete, deployable IaC in the SAME response using the recommended default. Order within the turn: (1) summary of what exists + what you’ll add, (2) explicit “confirm before I proceed” gate, (3) the generated IaC, (4) the “which to incorporate?” choice and any assumptions. Never end a turn with only a summary or a question, and never deploy before the user confirms. If you lack a value (region, an existing resource’s ID/name), declare a parameter and proceed. The confirmation gate governs deployment (Phase 7), not whether you generate the plan/IaC — you always generate; you never deploy without an explicit, risk-acknowledged go-ahead.
| Shape | Inputs | Referencing precision |
|---|---|---|
| Actual state | a live Azure resource, resource group, or subscription | real resource IDs → reference exactly (existing/data) |
| Declared state | Bicep / Terraform / ARM, or an infra plan (infrastructure-plan.json, terraform show -json) | logical → reference by parameter (or build, if it’s a spec) |
| Requirements/context | any general doc with info/requirements the user wants | mine for requirements + any existing-resource mentions |
Inputs can combine (e.g. a resource group + a requirements doc). If a declared file is ambiguous (“reference existing vs. build new?”), make the most likely assumption, state it, and generate — ask at most one question, after the code.
Never emit a new resource for a resource that already exists. Reference it.
Referenced mode does not skip Phase 7 — the deliverable is deployed new infrastructure that integrates with what already exists. Run phases/7-deploy.md with these guardrails:
existing/data (not resource), so a normal deploy never touches them.--mode Complete (it would delete resources absent from the template, including the referenced ones).
For Terraform, the referenced resources are data sources / imported, so apply must show no
destroy against them — abort if the plan proposes destroying or replacing a referenced resource.az deployment ... --what-if (Bicep) or terraform plan (Terraform)
and confirm the diff only creates new resources and modifies nothing on the referenced ones before
applying.insights.json — existing resources (real ID or param),
must_not_recreate, integration points, requirements, tier.outputs.X you consume is declared by that
module (prevents BCP053); (d) source unmodified.existing/data references + the wiring.
Real ID inline for actual-state; a param for declared/doc inputs.Private endpoints + publicNetworkAccess: Disabled on data services; managed identity over keys;
storage allowSharedKeyAccess: false; Key Vault soft-delete + purge protection; AKS managed identity +
disable local accounts; minimum TLS 1.2.