federalavd-policy-authoring
Skill18 starsChanged 3 months agoMITView on GitHub
Create, modify, review, and validate FederalAVD session-host Azure Policy definitions, initiatives, assignments, remediation templates, and policy RBAC. Use when changing Modify or DeployIfNotExists policies, nested deployment templates, policy sets, policy assignment parameters, compliance conditions, or policy deployment sequencing.
In this repository9 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- avd-alert-kql-validationSkill
- federalavd-air-gapped-readinessSkill
- federalavd-artifact-authoringSkill
- federalavd-bicep-maintenanceSkill
- federalavd-compliance-reviewSkill
- federalavd-deployment-dependency-reviewSkill
- federalavd-ui-form-maintenanceSkill
- federalavd-windows-policy-validationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 10 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 9
Use this workflow for policy resources under deployments/shared/modules/orchestration/sessionHostPolicy/.
- Distinctive: line 16
Start from the policy capability and trace its complete path:
- Very specific: line 31
Use Modify for properties changed on the evaluated VM, NIC, identity, or disk request.
- Very specific: line 32
Use DeployIfNotExists for related resources such as extensions, Run Commands, and data collection associations.
- Distinctive: line 34
Use an initiative only when member policies share lifecycle, assignment scope, remediation identity, and sequencing.
- Very specific: line 41
Treat policy definition and initiative files under the shared modules/ directory as direct deployment sources.
- Distinctive: line 49
Prefer Bicep for new remediation templates.
- Very specific: line 50
When a sibling .bicep exists, edit it and regenerate its adjacent .json.
- Very specific: line 54
Keep any PowerShell loaded with loadTextContent() ASCII-only and run parser and ASCII checks.
- Distinctive: line 56
Keep policy parameters aligned across every boundary:
- Distinctive: line 70
Keep RBAC synchronized with policy behavior:
- Very specific: line 72
Every role in a policy definition's roleDefinitionIds must have a corresponding assignment for the remediation identity.
- Distinctive: line 75
Keep the remediation identity, artifact-download identity, and VM system-assigned identity responsibilities distinct.
- Distinctive: line 77
Add explicit dependencies when assignment activation relies on RBAC propagation or another policy assignment.
- Distinctive: line 109
Every new definition output is consumed by its intended initiative or assignment.
- Distinctive: line 110
Every initiative member receives all required parameter mappings.
- Very specific: line 111
Every roleDefinitionIds entry is matched by deployed RBAC.
- Distinctive: line 116
Do not deploy policy resources as a separate repository-level stack.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
FederalAVD Policy Authoring
Use this workflow for policy resources under
deployments/shared/modules/orchestration/sessionHostPolicy/. Read its AUTHORING.md before
changing policy structure. Consumer entry points such as deployments/automatedHostPools/policy/
adapt and sequence these canonical modules but do not own policy implementations.
Procedure
Start from the policy capability and trace its complete path:
automatedHostPool.bicep -> policy/main.bicep -> policy definition or initiative -> policyAssignment.bicep -> remediation identity and role assignmentsTrace every affected consumer to the canonical shared orchestration. Keep one definition and deterministic assignment implementation; do not copy policy resources into consumer entry points.
Classify the behavior before editing:
- Use
Modifyfor properties changed on the evaluated VM, NIC, identity, or disk request. - Use
DeployIfNotExistsfor related resources such as extensions, Run Commands, and data collection associations. - Use an initiative only when member policies share lifecycle, assignment scope, remediation identity, and sequencing.
- Use
- Obtain current Bicep best practices and authoritative Azure resource schemas for every resource type being changed. For policy fields, effects, and aliases, verify current Microsoft Azure Policy documentation rather than inferring behavior from existing generated JSON.
- Treat policy definition and initiative files under the shared
modules/directory as direct deployment sources. Policy definition modules must declareMicrosoft.Authorization/policyDefinitions; initiative modules must declareMicrosoft.Authorization/policySetDefinitions. Do not generate standalone ARM files for these modules for another Bicep file to ingest. For a
DeployIfNotExistspolicy, maintain its nested remediation template under the sharedmodules/templates/directory:- Prefer Bicep for new remediation templates.
- When a sibling
.bicepexists, edit it and regenerate its adjacent.json; never hand-edit that generated JSON. - The policy-definition Bicep module loads the generated JSON with
loadJsonContent()and embeds it underdetails.deployment.properties.template. - Keep any PowerShell loaded with
loadTextContent()ASCII-only and run parser and ASCII checks.
Keep policy parameters aligned across every boundary:
- Policy definition parameter declaration.
- Policy rule references.
- Nested deployment parameter mapping for
DeployIfNotExists. - Initiative member parameter mapping, when applicable.
- Assignment parameter envelope in
policy/main.bicep. - Public automated-host-pool parameter and UI form, when user configurable.
- Make compliance checks measure the intended end state. Run Command policies in this repository use successful provisioning of the named Run Command as compliance. Do not use version changes to force existing hosts through a new customization unless the lifecycle contract is explicitly changed.
Keep RBAC synchronized with policy behavior:
- Every role in a policy definition's
roleDefinitionIdsmust have a corresponding assignment for the remediation identity. - Grant roles at the narrowest workable scope.
- Keep the remediation identity, artifact-download identity, and VM system-assigned identity responsibilities distinct.
- Add explicit dependencies when assignment activation relies on RBAC propagation or another policy assignment.
- Every role in a policy definition's
- Preserve the dedicated session-host resource group as the policy enforcement boundary. Do not broaden assignments for policies whose resource-type predicates rely on that isolation.
Build generated dependencies before their consumers. For each changed remediation Bicep file:
az bicep build ` --file <nested-template>.bicep ` --outfile <nested-template>.jsonCompile the policy stage, regenerate the tracked automated-host-pool ARM template, and verify synchronization:
az bicep build ` --file deployments/automatedHostPools/policy/main.bicep ` --stdout | Out-Null az bicep build ` --file deployments/automatedHostPools/automatedHostPool.bicep ` --outfile deployments/automatedHostPools/automatedHostPool.json & .github/skills/federalavd-bicep-maintenance/scripts/Test-BicepArmSync.ps1 ` -BicepPath deployments/automatedHostPools/automatedHostPool.bicepBefore finishing, verify:
- Every new definition output is consumed by its intended initiative or assignment.
- Every initiative member receives all required parameter mappings.
- Every
roleDefinitionIdsentry is matched by deployed RBAC. - Conditional definitions, initiatives, assignments, and RBAC use the same feature condition.
- Generated JSON changes are expected and
git diff --checkpasses. - The shared
AUTHORING.mdand affected consumer documentation remain accurate.
Do not deploy policy resources as a separate repository-level stack. They are an internal stage of the automated host-pool dependency graph.
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.

