AzSanityCheck¶
A PowerShell module designed to validate Azure infrastructure configurations against defined availability, security, and operational best practices.
Overview¶
AzSanityCheck is a collection of opinionated rules that detect commonly overlooked issues with deployed Azure infrastructure. It aims to codify specific "sanity checks" for Azure resources—verifying that deployments adhere to internal preferences and operational standards.
The project is currently in an active migration phase, evolving from ad-hoc analysis scripts (specifically targeting Azure Web Settings) into a structured, reusable PowerShell module.
Features¶
Current Capabilities¶
- Azure Web App Audits (In Migration):
- Logic from the reference script (
TestData/Get-CmgWebAppSettings.ps1) is being ported to native cmdlets. - Checks include:
- Security: HTTPS Only, TLS 1.2 enforcement, Managed Identity presence.
- Networking: VNet integration status, Access Restrictions.
- Configuration: AlwaysOn, HTTP Logging, Container/Runtime settings.
Planned Roadmap¶
- Migrate
Get-CmgWebAppSettingslogic into discrete cmdlets. - Implement a standardized reporting format (Object-based output with severity levels).
- Expand coverage to other resources (SQL, Storage, KeyVault).
Project Structure¶
Source/: Contains the module source code (Public/Private functions, Manifest).TestData/: Holds reference scripts and data used for prototyping logic (e.g.,Get-CmgWebAppSettings.ps1).Output/: Generated build artifacts (created after running the build script).build.ps1: The primary build orchestration script.
Getting Started¶
Prerequisites¶
- PowerShell 7.0 or higher
- ModuleBuilder module (for building from source)
Building the Module¶
To compile the module from the Source directory into a usable artifact in the Output directory, run the build script:
This will:
- Validate the module structure.
- Increment the version number (Patch by default; use
-minoror-majorto bump higher). - Update the manifest (
.psd1). - Generate the compiled module in
Output/AzSanityCheck.
Importing for Development¶
You can import the built module directly from the output directory using the provided helper:
Contributing¶
- Branch: Create a feature branch for your changes.
- Develop: specific functions in
Source/Public(exported) orSource/Private(internal helpers). - Build & Test: Run
./build.ps1to verify the module compiles correctly.
Note: This project is currently a Work In Progress. APIs and command names are subject to change.