azure-scaffold
Skill26 starsChanged 19 days agoMITView on GitHub
Documentation-only reference templates for the Azure execution layer a consumer repo needs to author IaC, deploy to Azure with OIDC, and govern infrastructure. Use when a squad agent or the coordinator scaffolds a dev container, OIDC setup script, Bicep/Terraform deploy workflows, a governance policy baseline, or the infra/ folder convention into a consumer repo. Templates never run from this package.
In this repository4 other files it gives its agents.
- squad-learnings-tenantSkill
- python-diagramsSkill
- sql-migration-advisorSkill
- squadSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 2 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Read installed squad/references/responsible-use.md once.
- Very specific: line 58
When the cloud-native pack is active (or a consumer requests a reusable container promotion pipeline), …
- Very specific: line 104
Merge MCP servers (optional): When the consumer wants the squad's recommended MCP wiring, merge the inputs and servers entries from the …
- Very specific: line 110
Wire identity: Run scripts/Setup-AzureOidc.ps1 once to create the federated identity and populate the GitHub secrets/variables the deploy …
- Distinctive: line 120
Every template follows these non-negotiable constraints (carried from the council verdict for this capability):
- Distinctive: line 124
No client secret, PAT, or long-lived credential is stored in the repo or in the templates.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!--
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
-->Azure Scaffold
Read installed squad/references/responsible-use.md once.
Overview
This skill bundles the documentation-only reference templates a consumer repository needs to do Azure work end-to-end — author Infrastructure-as-Code, deploy to Azure, and govern infrastructure — the way a deployable template repo ships them. Because hve-squad is an APM package (installed into a repo) rather than a template repo (cloned as a repo), it cannot ship live pipelines. Instead it ships these templates and a consumer-facing agent copies them into the consumer's repo on demand.
This mirrors the existing reference-template-in-a-skill pattern already used by the squad skill in
.github/skills/squad/ (mcp.template.json and github-approval-watcher.workflow.yml): the package
never reads or writes the consumer's .devcontainer/, .github/workflows/, scripts/, or infra/
trees. The consumer owns every copy, merge, and commit.
APM install brings the squad's agent context into a consumer repo; it never writes the consumer's
.vscode/ or .devcontainer/ trees. The dev container and the MCP wiring are therefore turnkey
through scaffolding rather than automatic on install: a consumer-facing squad agent or the
coordinator performs an explicit, logged, consumer-approved copy (or merge) when asked. This keeps
the clone-and-go convenience of a template repo while preserving the doc-only, consumer-owns-config
boundary an APM package requires.
Nothing here runs from the package. Each file below is an inert reference template. Activation is always an explicit, deliberate copy into the consumer repo followed by a reviewed commit.
Bundled Templates
| Template | Consumer destination | Purpose |
| devcontainer.template.json | .devcontainer/devcontainer.json | Dev container with Azure CLI + Bicep, Terraform + TFLint, GitHub CLI, Node.js, and Python. |
| mcp.template.json | .vscode/mcp.json (merge, do not overwrite) | Recommended MCP servers for squad roles: Azure DevOps and Azure, plus optional GitHub and pricing servers. |
| Setup-AzureOidc.template.ps1 | scripts/Setup-AzureOidc.ps1 | One-time wizard: Entra app registration, OIDC federated credentials, RBAC, and GitHub secrets. |
| deploy-bicep.workflow.yml | .github/workflows/deploy-bicep.yml | Bicep what-if + deploy via azure/login@v2 OIDC (no stored client secret). |
| deploy-terraform.workflow.yml | .github/workflows/deploy-terraform.yml | Terraform plan + apply via azure/login@v2 OIDC with an Azure Storage backend. |
| Get-PolicyBaseline.template.ps1 | scripts/Get-PolicyBaseline.ps1 | Read-only capture of effective Azure Policy assignments (with management-group inheritance). |
| governance-baseline.workflow.yml | .github/workflows/governance-baseline.yml | Scheduled run of the policy baseline that opens a PR when governance drifts. |
| reusable-cloud-native-cicd.workflow.yml | .github/workflows/reusable-cloud-native-cicd.yml | Reusable (workflow_call) golden-path pipeline for build-once SBOM/provenance attestation, fail-closed OpenVEX verification, and per-environment OIDC @sha256 digest promotion to Container Apps revisions or App Service slots. |
Platform Engineering Golden Paths & ADE Migration (2027-02-22)
When the cloud-native pack is active (or a consumer requests a reusable container promotion pipeline), reusable-cloud-native-cicd.workflow.yml provides an inert workflow_call golden path that pairs with deploy-bicep.workflow.yml and deploy-terraform.workflow.yml:
- Build-once and immutable
@sha256digest promotion:build-and-attestexecutes only wheninputs.image_digest == ''(initialdevbuild), emitting an SPDX SBOM and signing provenance/SBOM attestations (actions/attest-build-provenance,actions/attest-sbomwhen the repository is entitled). Subsequentstagingandprodcallers pass the verifiedsha256:<64-hex>digest ininputs.image_digest, skip rebuilding, verify provenance and OpenVEX against that exact digest, and promote${acr_login_server}/${app_name}@sha256:<digest>to an Azure Container Apps revision or Azure App Service deployment slot (never promoting a mutable:latestor branch tag). - Per-environment Microsoft Entra OIDC isolation &
job_workflow_refaccuracy: WhileSetup-AzureOidc.template.ps1bootstraps a single starter Entra application for initial setup, production multi-stage promotion must provision separate Entra user-assigned managed identities or app registrations per environment (dev,staging,prod) with resource-group-scoped least-privilege RBAC, bound to protected GitHub Deployment Environments (required_reviewers, deployment branch rules) and explicit namedworkflow_callsecrets:(AZURE_CLIENT_ID,AZURE_TENANT_ID,AZURE_SUBSCRIPTION_ID— never use implicit caller secret inheritance). Standard Microsoft Entra federated identity credentials evaluateissuer,audiences, andsubject(sub) only; Entra does not evaluatejob_workflow_refby default unless the GitHub organization or repository customizes the OIDCsubclaim template (include_claim_keysincludingjob_workflow_ref) or verified tenant-specific custom claims matching is configured. Pair environment subjects with customized GitHub OIDCsubtemplates and/or repository rulesets + required workflows, and never invoke the workflow frompull_request_targeton untrusted PR refs. - Fail-closed OpenVEX gate: Before
promote-environmentruns,verify-supply-chain-and-vexchecks that a human-reviewed, merged OpenVEX JSON document in the repository (never an unmerged draft under.copilot-tracking/security/vex/) matches the promoted@sha256:<digest>and carries a human author of record. Bothaffectedand unresolvedunder_investigationCVEs blockstagingandprodpromotion absent a time-bounded human-merged exception. - Role boundary (
iac-authorvs.release-engineeranddeployer):Squad IaC Author(iac-author) may only copyreusable-cloud-native-cicd.workflow.ymlverbatim and substitute documented<PLACEHOLDER>tokens upon explicit user confirmation. Any custom GitHub Actions workflow authoring, OpenVEX gate script customization, matrix/trigger modification, or pipeline hardening must escalate to the opt-inGitHub Actions Expert(release-engineer), which remains external and not seeded by default. Consumer GitHub Environment approvals do not substitute for the Squad Impactful-Action Gate (Squad Deployer). - Azure Deployment Environments (ADE) retirement (
2027-02-22) migration: ADE retires on February 22, 2027 (https://learn.microsoft.com/en-us/azure/deployment-environments/deployment-environments-retirement-guide). Do not onboard greenfield workloads to ADE; migrate existing ADE estates by (1) inventorying Dev Center catalogs,environment.yamldefinitions, and identities, (2) extracting Bicep/Terraform templates intoinfra/{track}/{project}AVM modules, (3) replacing ADE provisioning withreusable-cloud-native-cicd.workflow.yml(ordeploy-bicep.workflow.yml/deploy-terraform.workflow.yml) + protected GitHub Deployment Environments, and (4) offboarding ADE environment types before February 22, 2027.
The infra/ Folder Convention
Both IaC tracks live under a per-project infra/ tree so one repo can hold multiple workloads:
infra/
bicep/
{project}/
main.bicep # entry point (subscription- or resource-group-scoped)
modules/ # local modules; prefer AVM modules (br/public:avm/res/...)
main.bicepparam # parameters per environment
terraform/
{project}/
main.tf # root module
modules/ # local modules; prefer AVM (registry.terraform.io/Azure/avm-res-*)
backend.tf # Azure Storage backend config
*.tfvars # parameters per environmentThe Squad Azure Architect's LLD table maps one row per Azure resource to one resource declaration in
{project}/. The Squad IaC Author converts that table into the files above; the deploy workflows then
target infra/bicep/{project} or infra/terraform/{project} by a project input.
Scaffolding Flow
A consumer-facing squad agent (Squad IaC Author or Squad Deployer) or the coordinator scaffolds the Azure layer into a consumer repo with these steps. The flow is copy-then-commit; the package never writes these paths itself.
- Confirm intent and destinations. Identify which templates the consumer needs and confirm the destination paths in the table above. Never overwrite an existing consumer file without showing the diff and getting explicit approval.
- Copy and rename. Copy each template to its destination, dropping the
.template/.workflowmarker so the file becomes active in the consumer repo (for example,devcontainer.template.json→.devcontainer/devcontainer.json,deploy-bicep.workflow.yml→.github/workflows/deploy-bicep.yml). - Fill placeholders. Replace every
<PLACEHOLDER>token (subscription ID, resource group, region, project name, management-group ID) with the consumer's values. Leave no placeholder behind. - Merge MCP servers (optional). When the consumer wants the squad's recommended MCP wiring,
merge the
inputsandserversentries from the squad skill'smcp.template.json(the.vscode/mcp.jsonrow above) into the consumer's.vscode/mcp.jsonrather than overwriting it, preserving any servers they already configured. Remind the consumer to reload VS Code so Copilot picks up the new servers. As with every path here, the package never writes.vscode/mcp.jsonitself: a consumer-facing squad agent or the coordinator performs the merge on request. - Wire identity. Run
scripts/Setup-AzureOidc.ps1once to create the federated identity and populate the GitHub secrets/variables the deploy workflows consume. No client secret is ever stored. - Enable PR creation (governance only). For the governance baseline workflow, the consumer enables Settings → Actions → General → Allow GitHub Actions to create and approve pull requests.
- Commit deliberately. Stage and commit the scaffolded files in the consumer repo. Any actual Azure deployment runs only through the Squad Deployer, strictly behind the squad's Impactful-Action Gate.
Security Posture
Every template follows these non-negotiable constraints (carried from the council verdict for this capability):
- OIDC only. Authentication to Azure uses workload-identity federation through
azure/login@v2. No client secret, PAT, or long-lived credential is stored in the repo or in the templates. - Least privilege. The setup script assigns
Readerat the management-group scope andContributorat the subscription scope by default; narrow these to resource-group scope where the workload allows. - No embedded credentials. Templates contain only
<PLACEHOLDER>tokens and GitHubsecrets/varsreferences. The setup script never echoes secret values to the console or logs. - Deploys stay gated. Live deployment runs only through the Squad Deployer at the
confirmautonomy tier, behind the Impactful-Action Gate defined in.github/instructions/squad/squad-autopilot.instructions.md. The package itself deploys nothing. - Read-only governance. The policy baseline capture is read-only; it never mutates Azure Policy.
Prerequisites (consumer side, when the copied templates are used)
- An Azure subscription with Owner or User Access Administrator rights to run the OIDC setup once.
- The Azure CLI (
az) with the Bicep extension, and the GitHub CLI (gh) authenticated — both are provided bydevcontainer.template.json. - PowerShell 7+ to run the
.ps1scripts.
Troubleshooting
No subscription found— runaz loginandaz account set --subscription <id>before the setup script.- Workflow fails with
AADSTS700016/no matching federated identity record— the federated credential subject does not match the workflow'senvironment/branch. Re-runSetup-AzureOidc.ps1and confirm thesubjectmatchesrepo:<owner>/<repo>:environment:<env>. GitHub Actions is not permitted to create or approve pull requests— enable the setting in Settings → Actions → General (governance baseline workflow only).
Attribution
Part of hve-squad, built on Microsoft HVE Core agents and conventions.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

