Skip to content

Commit 8551ff2

Browse files
authored
Update documentation (#10)
* Add Policy Integration Tests documentation and configuration details * Add comprehensive documentation and sample test cases for Azure Policy Integration Tests - Created a global configuration document detailing properties for the policy integration test framework. - Added a local configuration document for storing test-specific variables. - Developed a main documentation file outlining the purpose, workflow, and execution of policy integration tests. - Introduced a policy testing overview document summarizing various tests included in the AzPolicyFactory solution. - Implemented sample test cases for various Azure resources including Network Security Groups, PostgreSQL, Private Endpoints, Storage Accounts, Virtual Networks, and Web Apps. * Fix typos and improve documentation clarity across multiple files * Add Markdown linting configuration and update documentation for policy integration tests * Update Super-Linter version and adjust Markdown config path in CI workflows * Fix formatting and improve clarity in documentation across multiple files * Fix typo in markdownlint configuration for emphasis heading rule
1 parent 068a4bf commit 8551ff2

55 files changed

Lines changed: 1044 additions & 228 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.azuredevops/pipelines/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# Introduction
2-
This folder contains the build and deploy pipelines in YAML format.
2+
3+
This folder contains the build and deploy pipelines in YAML format.

.azuredevops/pipelines/validation/azure-pipelines-pr-validation.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ stages:
2424
-e VALIDATE_BIOME_FORMAT=false \
2525
-e IGNORE_GITIGNORED_FILES=true \
2626
-e GITHUB_ACTIONS_ZIZMOR_CONFIG_FILE=.zizmor.yml \
27+
-e MARKDOWN_CONFIG_FILE=.markdownlint.json \
2728
-v $(System.DefaultWorkingDirectory):/tmp/lint \
28-
ghcr.io/super-linter/super-linter:v8.5.0
29+
ghcr.io/super-linter/super-linter:v8.6.0
2930
displayName: 'GitHub Super-Linter Code Scan'
3031

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
- @azure Rule - Use Azure Best Practices: When generating code for Azure, running terminal commands for Azure, or performing operations related to Azure, invoke your `get_azure_best_practices` tool if available.
1+
- @azure Rule - Use Azure Best Practices: When generating code for Azure, running terminal commands for Azure, or performing operations related to Azure, invoke your `get_azure_best_practices` tool if available.

.github/workflows/pr-code-scan.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ jobs:
4646
VALIDATE_ARM: false
4747
IGNORE_GITIGNORED_FILES: true
4848
GITHUB_ACTIONS_ZIZMOR_CONFIG_FILE: .zizmor.yml
49+
MARKDOWN_CONFIG_FILE: ../../.markdownlint.json

.markdownlint.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,15 @@
3939
},
4040
"no-multiple-space-blockquote": true,
4141
"no-blanks-blockquote": true,
42-
"ol-prefix": {
43-
"style": "one_or_ordered"
44-
},
42+
"ol-prefix": false,
4543
"list-marker-space": true,
4644
"blanks-around-fences": true,
4745
"blanks-around-lists": true,
4846
"no-bare-urls": false,
4947
"hr-style": {
5048
"style": "---"
5149
},
52-
"no-emphasis-as-header": true,
50+
"no-emphasis-as-heading": false,
5351
"no-space-in-emphasis": true,
5452
"no-space-in-code": true,
5553
"no-space-in-links": true,

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ This repository contains the complete set of IaC solutions for deploying Azure P
2525
- Deploying Azure Policy Definitions, Initiatives, Assignments, and Exemptions
2626
- PR Validation Code Scan using GitHub Super-Linter
2727
- PR Validation for Azure Policy Assignment configurations between production and development environments
28+
- Policy Integration Tests to test assigned policies on real resources in Azure and validate the expected results
2829

2930
The solution automates the entire lifecycle of Azure Policy resources — from code commit through testing and validation to production deployment — ensuring quality and correctness at every stage.
3031

@@ -39,7 +40,22 @@ The Azure Policy IaC solution in this repository includes the following key feat
3940
- Comprehensive set of tests and validation at different stages of the CI/CD pipelines to ensure the quality and correctness of the Azure Policy resources being deployed.
4041
- Follows industry best practices for Azure Policy management, safe deployment, code scan, and PR validation to ensure that the Azure Policy resources are deployed in a secure and compliant manner.
4142
- Unit tests for every policy resource being deployed.
42-
- Policy Integration Test (coming soon) to validate the functionality and effectiveness of the deployed Azure Policy resources in enforcing the desired governance and compliance requirements.
43+
- Policy Integration Test to validate the functionality and effectiveness of the deployed Azure Policy resources in enforcing the desired governance and compliance requirements.
44+
45+
### Tests for Azure Policy
46+
47+
The key to successfully implementing Azure Policy is to have confidence that your policies are correctly defined and will work as expected in your environment. The `AzPolicyFactory` solution is strongly focused in testing every step along the deployment process.
48+
49+
The following Tests are included in the `AzPolicyFactory` solution:
50+
51+
- **Policy Definitions and Initiatives Syntax Tests:** Static tests for syntax and best practices validation of policy definitions.
52+
- **Bicep Template PSRule Tests:** Validate Bicep templates for policy definitions using [PSRule for Azure](https://azure.github.io/PSRule.Rules.Azure/).
53+
- **Bicep Template Test Deployments:** Validate policy definition Bicep templates against Azure deployment engine to ensure they can be successfully deployed.
54+
- **Policy Assignments and Exemptions Syntax Tests:** Static tests for syntax validation of the configuration files for policy assignments and exemptions.
55+
- **Policy Assignments Environment Consistency Tests:** Validate that the policy assignments defined for production and development environments are consistent with each other to ensure the policies being tested in the development environment are the same as those being deployed to production.
56+
- **Policy Integration Tests:** Deploy real resources in Azure that are expected to either comply or violate the assigned policies, then validate the policy states and policy violation results to ensure the policies are working as expected in the Azure environment.
57+
58+
For more details on the tests included in this solution, please refer to the [Tests for Azure Policy](./policy-testing.md) documentation.
4359

4460
## Recommended Architectural Approach for Azure Policy IaC
4561

0 commit comments

Comments
 (0)