azure-monitor-baseline-alerts
Copilot instructions322 starsChanged 11 months agoMITView on GitHub
Azure Monitor Baseline Alerts (AMBA) is a comprehensive repository providing baseline alerting guidance and Infrastructure as Code (IaC) templates for Azure resources. The project includes a Hugo-based documentation website, Azure ARM/Bicep templates, and Python tooling for alert management. CRITICAL: Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here. NEVER CANCEL any build or test commands. All timing estimates include safety margins. ALWAYS run the…
- Installs packages
In this repositoryOne other file it gives its agents.
The file
Show its rules and text
We split this copilot-instructions.md into the rules it gives an agent
19 rules. About 0 are common, 10 are distinctive, and 9 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.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
CRITICAL: Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information …
- Very specific: line 103
Start Hugo server: hugo server -D
- Distinctive: line 105
Test key pages: Welcome, Patterns/ALZ, Services sections
- Distinctive: line 106
Verify search functionality works
- Distinctive: line 110
Run export script to verify processing works
- Distinctive: line 111
Check generated outputs contain your changes
- Distinctive: line 116
Check for any compilation errors
- Very specific: line 166
Check Hugo version: hugo version (must be 0.117.0+ Extended)
- Very specific: line 167
Verify config file syntax in config/_default/hugo.toml
- Very specific: line 168
Check for missing theme: docs/themes/hugo-theme-relearn/ must exist
- Very specific: line 172
Check Python version: python3 --version (requires 3.12+)
- Distinctive: line 173
Verify YAML syntax in alert definition files
- Very specific: line 176
Check Bicep installation: bicep --version
- Distinctive: line 177
Verify template syntax and references
- Distinctive: line 178
Ensure all referenced files exist
- Very specific: line 205
Check generated site at http://localhost:1313/azure-monitor-baseline-alerts/
- Very specific: line 211
Test deployment parameters in patterns/alz/alzArm.param.json
- Very specific: line 217
alerts.yaml changes: Run export script to update consolidated outputs
- Distinctive: line 220
Policy changes: Update and compile relevant policy template files
≈ “Common” is an estimate: at least 1 in 5 of the 1,645 Copilot instructions 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
Azure Monitor Baseline Alerts (AMBA)
Azure Monitor Baseline Alerts (AMBA) is a comprehensive repository providing baseline alerting guidance and Infrastructure as Code (IaC) templates for Azure resources. The project includes a Hugo-based documentation website, Azure ARM/Bicep templates, and Python tooling for alert management.
CRITICAL: Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
Working Effectively
Bootstrap, Build, and Test the Repository
NEVER CANCEL any build or test commands. All timing estimates include safety margins.
- Install Hugo Extended (Required for documentation site):
wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.117.0/hugo_extended_0.117.0_linux-amd64.deb sudo dpkg -i /tmp/hugo.deb hugo version # Verify installation - Install Python dependencies:
# For alert export tooling cd tooling/export-alerts pip install -r requirements.txt # Installs pyyaml, openpyxl # For template generation cd ../generate-templates pip install -r requirements.txt # Installs pyyaml - Build Hugo documentation site:
cd /path/to/repo/root hugo --gc --minify- Duration: 15 seconds - NEVER CANCEL. Set timeout to 60+ seconds.
- Output: Static site files in
./public/directory - Pages generated: ~432 pages, ~735 non-page files, ~3001 static files
- Export alert definitions (validates Python tooling):
cd tooling/export-alerts python export-alerts.py --path ../../services --template ./alerts-template.xlsx --output-xls ../../services/amba-alerts.xlsx --output-json ../../services/amba-alerts.json --output-yaml ../../services/amba-alerts.yaml- Duration: 5 seconds - NEVER CANCEL. Set timeout to 30+ seconds.
- Output: Generates Excel, JSON, and YAML files with consolidated alert definitions
Run the Development Environment
ALWAYS run the bootstrapping steps first.
- Run Hugo development server:
hugo server -D- Duration: 15 seconds initial build - NEVER CANCEL. Set timeout to 60+ seconds.
- Access: http://localhost:1313/azure-monitor-baseline-alerts/
- Note: Server watches for changes and rebuilds automatically
- Test Bicep compilation:
# Example: Compile policy set definitions bicep build patterns/alz/templates/policySets.bicep --outfile /tmp/policySets.json # Example: Compile network policies bicep build patterns/alz/templates/policies-Network.bicep --outfile /tmp/policies-Network.json- Duration: 3-5 seconds per file - NEVER CANCEL. Set timeout to 30+ seconds.
Validation
ALWAYS manually validate any new code via the following steps after making changes.
Required Validation Steps
- YAML validation (for alert definitions):
python .github/yml-schemas/validate_yml.py "path/to/alerts.yaml"- Duration: <5 seconds - Set timeout to 30+ seconds.
- Purpose: Validates alert definition schema compliance
- Hugo site build validation:
hugo --gc --minify- Duration: 15 seconds - NEVER CANCEL. Set timeout to 60+ seconds.
- Purpose: Ensures documentation builds successfully
- Alert export validation:
cd tooling/export-alerts python export-alerts.py --path ../../services --template ./alerts-template.xlsx --output-xls /tmp/test-alerts.xlsx --output-json /tmp/test-alerts.json --output-yaml /tmp/test-alerts.yaml- Duration: 5 seconds - Set timeout to 30+ seconds.
- Purpose: Ensures alert processing tooling works correctly
Manual Testing Scenarios
ALWAYS test these scenarios after making changes to ensure functionality:
- Documentation Site Navigation:
- Start Hugo server:
hugo server -D - Navigate to http://localhost:1313/azure-monitor-baseline-alerts/
- Test key pages: Welcome, Patterns/ALZ, Services sections
- Verify search functionality works
- Start Hugo server:
- Alert Definition Processing:
- Modify an alert in
services/{service}/{resource}/alerts.yaml - Run export script to verify processing works
- Check generated outputs contain your changes
- Modify an alert in
- Bicep Template Validation:
- Make changes to templates in
patterns/alz/templates/ - Compile with
bicep buildto verify syntax - Check for any compilation errors
- Make changes to templates in
CI Validation Requirements
Always run these commands before committing to ensure CI will pass:
- YAML Schema Validation:
# Test changed YAML files python .github/yml-schemas/validate_yml.py "path/to/changed/alerts.yaml" - Hugo Build Check:
hugo --gc --minify- Must complete successfully - site must build without errors
- Bicep Compilation Check:
# For any modified .bicep files bicep build path/to/template.bicep --outfile /tmp/output.json
Repository Structure and Key Locations
Most Important Directories
docs/: Hugo documentation source filesdocs/content/: Markdown content for the websitedocs/themes/hugo-theme-relearn/: Relearn theme for Hugo
services/: Alert definitions organized by Azure serviceservices/{Service}/{Resource}/alerts.yaml: Alert definitionsservices/{Service}/{Resource}/templates/: ARM/Bicep templates
patterns/alz/: Azure Landing Zone (ALZ) patterns and policiespatterns/alz/templates/: Bicep policy templatespatterns/alz/policyDefinitions/: Generated policy definitions
tooling/: Python scripts for processing alerts and templatestooling/export-alerts/: Script to export consolidated alert definitionstooling/generate-templates/: Script to generate ARM/Bicep templates
Key Configuration Files
config/_default/hugo.toml: Hugo site configuration.github/workflows/: GitHub Actions workflows for CI/CD.github/linters/: Linting configuration (.markdown-lint.yml, .eslintrc.yml)
Common Build Errors and Solutions
- Hugo Build Fails:
- Check Hugo version:
hugo version(must be 0.117.0+ Extended) - Verify config file syntax in
config/_default/hugo.toml - Check for missing theme:
docs/themes/hugo-theme-relearn/must exist
- Check Hugo version:
- Python Script Errors:
- Install dependencies:
pip install -r requirements.txtin appropriate tooling directory - Check Python version:
python3 --version(requires 3.12+) - Verify YAML syntax in alert definition files
- Install dependencies:
- Bicep Compilation Errors:
- Check Bicep installation:
bicep --version - Verify template syntax and references
- Ensure all referenced files exist
- Check Bicep installation:
Timing Expectations
CRITICAL: Set appropriate timeouts for all operations. These are measured times with safety margins:
- Hugo site build: 15 seconds (set timeout: 60+ seconds)
- Hugo server startup: 15 seconds (set timeout: 60+ seconds)
- Python alert export: 5 seconds (set timeout: 30+ seconds)
- Bicep compilation: 3-5 seconds per file (set timeout: 30+ seconds)
- YAML validation: <5 seconds (set timeout: 30+ seconds)
- Python dependency installation: 10-30 seconds (set timeout: 120+ seconds)
Common Development Tasks
Adding New Alert Definitions
- Navigate to appropriate service directory:
services/{Service}/{Resource}/ - Edit
alerts.yamlfile following existing schema - Test with:
python .github/yml-schemas/validate_yml.py "services/{Service}/{Resource}/alerts.yaml" - Regenerate outputs:
cd tooling/export-alerts && python export-alerts.py --path ../../services --template ./alerts-template.xlsx --output-xls ../../services/amba-alerts.xlsx --output-json ../../services/amba-alerts.json --output-yaml ../../services/amba-alerts.yaml
Modifying Documentation
- Edit markdown files in
docs/content/ - Test locally:
hugo server -D - Verify build:
hugo --gc --minify - Check generated site at http://localhost:1313/azure-monitor-baseline-alerts/
Working with ALZ Policies
- Modify Bicep templates in
patterns/alz/templates/ - Compile:
bicep build patterns/alz/templates/{template}.bicep --outfile /tmp/{template}.json - Test deployment parameters in
patterns/alz/alzArm.param.json
File Type Handlers
Always check these file locations after making changes:
- alerts.yaml changes: Run export script to update consolidated outputs
- Bicep template changes: Compile with
bicep buildto verify syntax - Documentation changes: Build Hugo site to verify rendering
- Policy changes: Update and compile relevant policy template files
This repository does NOT require traditional package managers like npm or traditional build systems like Make. The toolchain is Hugo + Python + Bicep CLI.
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.

