PSRule for Azure is aligned to the Azure Well-Architected Framework (WAF). Tests called rules check the configuration of Azure resources against WAF principles. Rules exist across five (5) WAF pillars:
- Cost Optimization
- Operational Excellence
- Performance Efficiency
To help you align your Infrastructure as Code (IaC) to WAF principles, PSRule for Azure includes documentation. Included are examples, references to WAF and product documentation. This allows you to explore and learn the context of each WAF principle.
Ready to go#
PSRule for Azure includes over 230 rules for validating resources against configuration recommendations. Rules automatically detect and analyze resources from Azure IaC artifacts. This allows you to quickly light up unit testing of Azure resources from templates and Bicep deployments.
Use the built-in rules to start enforcing testing quickly. Then layer on your own rules as your organization's requirements mature. Custom rules can be implemented quickly and work side-by-side with built-in rules.
As new built-in rules are added and improved, download the latest version to start using them.
For detailed information on building custom rules see:
Azure resources can be validated throughout their lifecycle to support a DevOps culture. From as early as authoring an ARM template, resources can be validated offline before deployment.
Pre-flight validation can be integrated into a continuous integration (CI) pipeline as unit tests to:
- Shift-left — Identify configuration issues and provide fast feedback in PRs.
- Quality gates — Implement quality gates between environments such as development, test, and production.
- Monitor continuously — Perform ongoing checks for configuration optimization opportunities.
PSRule for Azure uses modern PowerShell libraries at its core, allowing it to go anywhere PowerShell can go. PSRule for Azure runs on MacOS, Linux, and Windows.
PowerShell makes it easy to integrate PSRule into popular CI systems. Run natively or in a container depending on your platform. PSRule has native extensions for:
Additionally, PSRule for Azure can be installed locally or within Azure Cloud Shell. For installation options see installation.