agentleFS
MicrosoftKnown publishermicrosoft/finops-toolkit/src/templates/agent-skills/azure-policy-governance/SKILL.md

azure-policy-governance

Skill633 starsChanged 3 months agoMITView on GitHub

Use when the user wants to enforce cost governance with Azure Policy — require or inherit tags, restrict regions/SKUs/resource types, audit untagged resources, or generate Bicep/ARM policy assignments. Pairs with the finops-multitool policy scans to close governance gaps.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When asked for Bicep:

    line 52
  2. Very specific:

    Use the Bicep MCP tools to validate the Microsoft.Authorization/policyAssignments schema and run diagnostics before presenting the file.

    line 55

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

Azure Policy for cost governance

Enforce the guardrails that make FinOps allocation and waste-control durable: tag requirements, tag inheritance, region/SKU restrictions, and audit policies. This skill turns governance gaps into deployable policy for the user to review and apply. Don't assign policy or start remediation yourself; the FinOps skills are read-only.

When to use this skill

Use it when the user wants to enforce or audit tagging, restrict what can be deployed, or asks for "a policy" to back up a FinOps recommendation. Run policy inventory and policy recommendations from the finops-multitool skill first to see what's already assigned and where the gaps are, then generate policy here.

Workflow

  1. Inventory — policy inventory (existing assignments, scopes, effects, compliance).
  2. Gap analysis — policy recommendations (missing tagging/region/SKU guardrails).
  3. Verify definition IDs — built-in policy IDs change rarely but must be confirmed. Use the Microsoft Learn MCP / docs before emitting any ID into a template. Do not ship an ID from memory.
  4. Generate — produce Bicep or ARM for the assignment(s), parameterized and scoped.
  5. Stage effects — recommend that the user deploy Audit/AuditIfNotExists first, review compliance, then move to Deny/Modify. Never lead with Deny on an existing environment.

Core cost-governance policies

GoalBuilt-in policy (verify ID before use)Effect
Require a tag on resource groups"Require a tag on resource groups"Deny
Require a tag on resources"Require a tag on resources"Deny
Inherit a tag from the resource group"Inherit a tag from the resource group"Modify
Audit missing tag"Require a tag and its value on resources" (audit variant)Audit
Allowed locations"Allowed locations"Deny
Allowed resource types"Allowed resource types"Deny
Allowed VM SKUs"Allowed virtual machine size SKUs"Deny

Modify and DeployIfNotExists policies require a managed identity on the assignment with rights to remediate. Tell the user to create a remediation task after they assign the policy, so existing resources are brought into compliance, not just new ones.

Effect sequencing (safe rollout)

Audit  →  review compliance  →  Modify/Append (auto-fix)  →  remediate existing  →  Deny (block new violations)

Apply the same tag key across all three layers (require on RG, inherit to resources, deny new untagged) so the allocation model from the cost-allocation skill is enforced end to end.

Generating templates

When asked for Bicep:

  • Parameterize the tag name, allowed values/locations/SKUs, scope, and effect.
  • Set enforcementMode to DoNotEnforce for a dry run when the user wants to preview impact.
  • Use the Bicep MCP tools to validate the Microsoft.Authorization/policyAssignments schema and run diagnostics before presenting the file.
  • Output one assignment per concern; don't bundle unrelated guardrails into a single assignment.

Hand-offs

  • Decide which tags to enforce → cost-allocation skill.
  • See current gaps → finops-multitool policy scans.
  • Report compliance trend visually → power-bi-finops (governance report) or azure-workbooks-finops.

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.