agentleFS
MicrosoftKnown publishermicrosoft/hve-squad/squad-src/.github/skills/azure-scaffold/SKILL.md

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.

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
  1. Very specific:

    Read installed squad/references/responsible-use.md once.

    line 17
  2. Very specific:

    When the cloud-native pack is active (or a consumer requests a reusable container promotion pipeline), …

    line 58
  3. Very specific:

    Merge MCP servers (optional): When the consumer wants the squad's recommended MCP wiring, merge the inputs and servers entries from the …

    line 104
  4. Very specific:

    Wire identity: Run scripts/Setup-AzureOidc.ps1 once to create the federated identity and populate the GitHub secrets/variables the deploy …

    line 110
  5. Distinctive:

    Every template follows these non-negotiable constraints (carried from the council verdict for this capability):

    line 120
  6. Distinctive:

    No client secret, PAT, or long-lived credential is stored in the repo or in the templates.

    line 124

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- 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

TemplateConsumer destinationPurpose
devcontainer.template.json.devcontainer/devcontainer.jsonDev 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.ps1scripts/Setup-AzureOidc.ps1One-time wizard: Entra app registration, OIDC federated credentials, RBAC, and GitHub secrets.
deploy-bicep.workflow.yml.github/workflows/deploy-bicep.ymlBicep what-if + deploy via azure/login@v2 OIDC (no stored client secret).
deploy-terraform.workflow.yml.github/workflows/deploy-terraform.ymlTerraform plan + apply via azure/login@v2 OIDC with an Azure Storage backend.
Get-PolicyBaseline.template.ps1scripts/Get-PolicyBaseline.ps1Read-only capture of effective Azure Policy assignments (with management-group inheritance).
governance-baseline.workflow.yml.github/workflows/governance-baseline.ymlScheduled run of the policy baseline that opens a PR when governance drifts.
reusable-cloud-native-cicd.workflow.yml.github/workflows/reusable-cloud-native-cicd.ymlReusable (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 @sha256 digest promotion: build-and-attest executes only when inputs.image_digest == '' (initial dev build), emitting an SPDX SBOM and signing provenance/SBOM attestations (actions/attest-build-provenance, actions/attest-sbom when the repository is entitled). Subsequent staging and prod callers pass the verified sha256:<64-hex> digest in inputs.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 :latest or branch tag).
  • Per-environment Microsoft Entra OIDC isolation & job_workflow_ref accuracy: While Setup-AzureOidc.template.ps1 bootstraps 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 named workflow_call secrets: (AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID — never use implicit caller secret inheritance). Standard Microsoft Entra federated identity credentials evaluate issuer, audiences, and subject (sub) only; Entra does not evaluate job_workflow_ref by default unless the GitHub organization or repository customizes the OIDC sub claim template (include_claim_keys including job_workflow_ref) or verified tenant-specific custom claims matching is configured. Pair environment subjects with customized GitHub OIDC sub templates and/or repository rulesets + required workflows, and never invoke the workflow from pull_request_target on untrusted PR refs.
  • Fail-closed OpenVEX gate: Before promote-environment runs, verify-supply-chain-and-vex checks 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. Both affected and unresolved under_investigation CVEs block staging and prod promotion absent a time-bounded human-merged exception.
  • Role boundary (iac-author vs. release-engineer and deployer): Squad IaC Author (iac-author) may only copy reusable-cloud-native-cicd.workflow.yml verbatim 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-in GitHub 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.yaml definitions, and identities, (2) extracting Bicep/Terraform templates into infra/{track}/{project} AVM modules, (3) replacing ADE provisioning with reusable-cloud-native-cicd.workflow.yml (or deploy-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 environment

The 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.

  1. 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.
  2. Copy and rename. Copy each template to its destination, dropping the .template / .workflow marker 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).
  3. 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.
  4. Merge MCP servers (optional). When the consumer wants the squad's recommended MCP wiring, merge the inputs and servers entries from the squad skill's mcp.template.json (the .vscode/mcp.json row above) into the consumer's .vscode/mcp.json rather 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.json itself: a consumer-facing squad agent or the coordinator performs the merge on request.
  5. Wire identity. Run scripts/Setup-AzureOidc.ps1 once to create the federated identity and populate the GitHub secrets/variables the deploy workflows consume. No client secret is ever stored.
  6. 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.
  7. 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 Reader at the management-group scope and Contributor at the subscription scope by default; narrow these to resource-group scope where the workload allows.
  • No embedded credentials. Templates contain only <PLACEHOLDER> tokens and GitHub secrets/vars references. 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 confirm autonomy 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 by devcontainer.template.json.
  • PowerShell 7+ to run the .ps1 scripts.

Troubleshooting

  • No subscription found — run az login and az 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's environment/branch. Re-run Setup-AzureOidc.ps1 and confirm the subject matches repo:<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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.