Contributing Guide¶
Thank you for your interest in contributing to azurelocal-avd!
Code of Conduct¶
Be respectful and constructive. This project follows the Microsoft Open Source Code of Conduct.
Branch Strategy¶
| Branch | Purpose |
|---|---|
main |
Stable, production-ready code |
dev |
Integration branch for feature work |
feature/<name> |
Individual feature or fix branches |
hotfix/<name> |
Urgent production fixes |
All changes go through a Pull Request targeting dev, which is then merged to main on release.
Getting Started¶
- Fork the repository and clone your fork.
- Create a feature branch:
git checkout -b feature/my-improvement - Make your changes (see conventions below).
- Push and open a PR against
dev.
Coding Conventions¶
PowerShell¶
- Use
[CmdletBinding(SupportsShouldProcess)]on all deployment scripts. - Set
Set-StrictMode -Version Latestand$ErrorActionPreference = "Stop"at the top. - Use approved PowerShell verbs (
New-,Set-,Remove-,Test-). - Include comment-based help (
.SYNOPSIS,.DESCRIPTION,.PARAMETER,.EXAMPLE). - Use
Write-Hostwith-ForegroundColorfor status messages; useWrite-Verbosefor debug detail. - Support a
parameters.ps1file pattern (seeparameters.example.ps1insrc/powershell/).
Azure CLI / Bash¶
- Use
set -euo pipefailat the top of every script. - Source a
parameters.shfile for environment-specific values. - Use
azresource existence checks before creating resources (idempotent deployments). - Echo section headers and success/failure messages.
Bicep¶
- Use
targetScope = 'subscription'for control-plane templates (resource group creation) andtargetScope = 'resourceGroup'for session-host templates. - Break resources into modules or separate
.bicepresource files. - Include
@description()decorators on all parameters. - Provide a
*.bicepparam.examplefile for everymain.bicep. - Prefer
existingresource references over hard-coded resource IDs where possible.
ARM¶
- Use
$schemaversion2019-04-01for subscription-scope templates and2022-09-01for resource-group scope. - Include a
parameters.example.jsonalongside everyazuredeploy.json. - Do not store secrets in parameter files; use
"reference": { "keyVault": ... }.
Terraform¶
- Pin provider versions in
versions.tf. - Use
variables.tffor all input variables withdescriptionandtype. - Provide
outputs.tfwith meaningful outputs. - Include
terraform.tfvars.examplebut never committerraform.tfvars(it is.gitignored). - Use
terraform fmtbefore committing.
Ansible¶
- Roles follow the standard Ansible role directory layout.
- Use
defaults/main.ymlfor overridable defaults. - Tasks should be idempotent (check before acting).
- Use Ansible Vault for secrets; do not commit plaintext passwords.
Pull Request Checklist¶
- [ ] Code follows the conventions above for the relevant tool.
- [ ] A
parameters.example.*or*.examplefile is provided for any new deployment. - [ ] README updated if new files or parameters were added.
- [ ] No secrets, passwords, or subscription IDs committed.
- [ ] Tested against a real Azure / Azure Local environment (note testing notes in the PR).
Reporting Issues¶
Open a GitHub Issue with: - A clear description of the problem. - The tool / folder affected. - Steps to reproduce. - Relevant error messages or logs.