Skip to content

Commit a3ab1bd

Browse files
committed
Fix typos and improve documentation clarity across multiple files
1 parent 8994221 commit a3ab1bd

11 files changed

Lines changed: 55 additions & 50 deletions

docs/FAQ.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The pipeline / workflow parameters for excluded tags for each test type are as f
9393
At the moment, the following Pester tests used in this project do not support excluding tags:
9494

9595
- Bicep Support File tests
96-
- PSRule tests (configured using the PSRule configuration file [ps-rule.yaml](../ps-rule.yaml))
96+
- PSRule tests (configured using the PSRule configuration file [ps-rule.yml](../.ps-rule/ps-rule.yml))
9797
- Policy Assignment Environment Consistency tests
9898

9999
</details>
@@ -295,11 +295,11 @@ However, we do not need to recreate all the production subscriptions in the poli
295295
<details>
296296
<summary>Click to expand</summary>
297297

298-
When deploying Policy deifnitions and initiatives, the same artifacts are deployed to both development and production management group hierarchies. Unlike policy definitions and initiatives, the policy assignments have different configurations for each environment.
298+
When deploying Policy definitions and initiatives, the same artifacts are deployed to both development and production management group hierarchies. Unlike policy definitions and initiatives, the policy assignments have different configurations for each environment.
299299

300300
There is no way to test the exact same policy assignment configuration in the development environment before deploying to production because the resources referenced in the policy assignment for the development environment are different from those in production and some assignments may have different settings between environments.
301301

302-
The Policy Assignment Environment Consistency tests PR validation pipeline was the result of an actual failed policy deployment in production environments in a customers environment due to the inconsistency between the policy assignment configurations for development and production environments.
302+
The Policy Assignment Environment Consistency tests PR validation pipeline was the result of an actual failed policy deployment in production environments in a customer's environment due to the inconsistency between the policy assignment configurations for development and production environments.
303303

304304
The tests are designed to validate the consistency of the policy assignment configurations between development and production environments to prevent such issues from happening again in the future.
305305

@@ -314,23 +314,23 @@ Refer to the [Policy Assignment Environment Consistency Tests documentation](./a
314314

315315
Troubleshooting the policy integration test pipeline failure can be hard because by default the pipeline will remove the deployed resources at the end of the test run, which makes it hard to investigate the failed resources in Azure.
316316

317-
To make it easier to troubleshoot the failures, we have added few parameters in the Pipeline / workflow to allow you to keep the deployed resources in Azure after the test run for investigation and have verbosed output in the pipeline logs to provide more context on the test execution and failure.
317+
To make it easier to troubleshoot the failures, we have added few parameters in the Pipeline / workflow to allow you to keep the deployed resources in Azure after the test run for investigation and have verbose output in the pipeline logs to provide more context on the test execution and failure.
318318

319319
You can manually execute the Policy Integration Test pipeline / workflow with the following parameters:
320320

321-
** Azure DevOps Pipeline Parameters **
321+
**Azure DevOps Pipeline Parameters**
322322

323-
![ADO Pipeline Parameters 1](./assets/pol-int-test-ado-parameters-01.png)
323+
![ADO Pipeline Parameters 1](./images/pol-int-test-ado-parameters-01.png)
324324

325-
![ADO Pipeline Parameters 2](./assets/pol-int-test-ado-parameters-02.png)
325+
![ADO Pipeline Parameters 2](./images/pol-int-test-ado-parameters-02.png)
326326

327-
** GitHub Action Workflow Inputs **
327+
**GitHub Action Workflow Inputs**
328328

329-
![GitHub Action Workflow Inputs](./assets/pol-int-test-gh-inputs.png)
329+
![GitHub Action Workflow Inputs](./images/pol-int-test-gh-inputs.png)
330330

331331
- **Remove Test Resources:** Untick this parameter to keep the deployed resources in Azure after the test run for investigation. By default, this parameter is set to `true` which means the deployed resources will be removed at the end of the test run.
332332
- **Tests To Run (separate with commas ','):** Specify the test cases you want to run. By default, all test cases will be executed. You can specify the test cases by their test names defined in the local configuration file for each test case (e.g. `storage-account`, `key-vault`).
333-
- **Enable system diagnostics (ADO) / Enable debug logging (GitHub Actions):** Enable this option to have more verbosed output in the pipeline logs for troubleshooting. By default, this option is set to `false` which means the pipeline logs will not be verbosed.
333+
- **Enable system diagnostics (ADO) / Enable debug logging (GitHub Actions):** Enable this option to have more verbose output in the pipeline logs for troubleshooting. By default, this option is set to `false` which means the pipeline logs will not be verbose.
334334

335335
>:memo: Remember to clean up the deployed resources manually in Azure after you have finished the investigation if you choose to keep the resources for troubleshooting.
336336
@@ -346,7 +346,7 @@ Currently there are 2 Terraform providers for Azure:
346346
- [AzureRM Provider](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs) - The most widely used Terraform provider for Azure, which supports a wide range of Azure resources and is maintained by HashiCorp in collaboration with Microsoft.
347347
- [AzAPI Provider](https://registry.terraform.io/providers/Azure/azapi/latest/docs) - A newer Terraform provider for Azure, which provides support for Azure resources that are not yet supported in the AzureRM provider by directly calling the Azure REST APIs.
348348

349-
Natively in Azure Resource Manager deployment API, the [`what-if` API]((https://learn.microsoft.com/rest/api/resources/deployments/what-if?view=rest-resources-2025-04-01&tabs=HTTP)) can be used to validate a deployment against assigned policies with `deny` effect. However, since `terraform plan` command does not use the ARM deployment APIs, it does not have the capability for Azure Policy evaluation.
349+
Natively in Azure Resource Manager deployment API, the [`what-if` API](https://learn.microsoft.com/rest/api/resources/deployments/what-if?view=rest-resources-2025-04-01&tabs=HTTP) can be used to validate a deployment against assigned policies with `deny` effect. However, since `terraform plan` command does not use the ARM deployment APIs, it does not have the capability for Azure Policy evaluation.
350350

351351
We are leveraging the [Policy Restriction API](https://learn.microsoft.com/rest/api/policyinsights/policy-restrictions?view=rest-policyinsights-2024-10-01) to evaluate the resource configuration for Terraform. This API supports both `deny` and `audit` effect policies.
352352

@@ -411,9 +411,9 @@ The `Get Test Configuration` job in the Policy Integration Test pipeline / workf
411411
- Which test configurations from the `AzResourceTest` module are used by each test case
412412
- Which subscriptions are targeted for each test case based on the test configuration
413413

414-
It also retrieves the required wait time for each policy effect type from the [Polcy Integration Test global configuration file](./policy-integration-tests-global-config.md).
414+
It also retrieves the required wait time for each policy effect type from the [Policy Integration Test global configuration file](./policy-integration-tests-global-config.md).
415415

416-
From here, it determines wchich subscriptions will need to trigger the policy compliance scan (based on the use of the `New-ARTPolicyStateTestConfig` command), and what is the maximum wait time for the pipeline based on the configuration from the global configuration file.
416+
From here, it determines which subscriptions will need to trigger the policy compliance scan (based on the use of the `New-ARTPolicyStateTestConfig` command), and what is the maximum wait time for the pipeline based on the configuration from the global configuration file.
417417

418418
The Pipeline then uses the output of this job to trigger (or skip triggering) the policy compliance scan for each required subscription in the subsequent job after the resource deployment, and to determine how long it should wait before checking the policy compliance state for the test resources.
419419
</details>
@@ -441,7 +441,7 @@ The following properties in the [Policy Integration Test global configuration fi
441441

442442
In the [local configuration file](./policy-integration-tests-local-config.md) of each test case, the `policyAssignmentIds` property defines the required policy assignments for the test case.
443443

444-
If any of the required policy assignments are missing the test case will fail
444+
If any of the required policy assignments are missing, the test case will fail.
445445

446-
If anye of the required policy assignments are not evaluated yet (after initial deployment or after a change is made to the policy assignment), the Policy Integration Test pipeline / workflow will wait for up to 20 minutes for the policy assignments to complete the initial evaluation cycle.
446+
If any of the required policy assignments are not evaluated yet (after initial deployment or after a change is made to the policy assignment), the Policy Integration Test pipeline / workflow will wait for up to 20 minutes for the policy assignments to complete the initial evaluation cycle.
447447
</details>

docs/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,19 @@ The following DevOps / CICD platforms are supported:
1515
| Policy Initiatives | [Documentation](ado-pipelines/policy-initiatives.md) | [Documentation](github-action/policy-initiatives.md) | Deploys Azure Policy initiatives (policy sets) to the target Azure environment |
1616
| Policy Assignments | [Documentation](ado-pipelines/policy-assignments.md) | [Documentation](github-action/policy-assignments.md) | Deploys Azure Policy assignments based on environment-specific configuration files |
1717
| Policy Exemptions | [Documentation](ado-pipelines/policy-exemptions.md) | [Documentation](github-action/policy-exemptions.md) | Deploys Azure Policy exemptions based on environment-specific configuration files |
18-
| PR Validation Code Scan | [Documentation](ado-pipelines/pr-validation.md) | [Documentation](github-action/pr-code-scan.md) | Runs GitHub Super-Linter to validate code quality and syntax in pull requests |
19-
| PR Validation for Policy Assignment Consistency | [Documentation](ado-pipelines/pr-policy-assignment-env-consistency.md) | [Documentation](github-action/pr-policy-assignment-env-consistency.md) | Validates that policy assignment configurations in development and production environments are consistent and do not contain unintended differences |
18+
19+
## Test and Validation Pipelines and Workflows
20+
21+
- PR Validation Code Scan: Runs GitHub Super-Linter to validate code quality and syntax in pull requests
22+
- PR Validation for Policy Assignment Consistency:Validates that policy assignment configurations in development and production environments are consistent and do not contain unintended differences |
2023

2124
## Instructions
2225

2326
- [Setup Guide for Azure DevOps Pipelines](ado-pipelines/setup-guide.md)
2427
- [Setup Guide for GitHub Actions Workflows](github-action/setup-guide.md)
2528
- [Add Policy Resources to the Repository](add-policy-resources.md)
2629
- [Policy Assignment Environment Consistency Tests](assignment-environment-consistency-tests.md)
27-
- [How to generate documentations for Bicep templates and modules](generate-bicep-docs.md)
30+
- [How to generate documentation for Bicep templates and modules](generate-bicep-docs.md)
2831
- [Policy Integration Tests](policy-integration-tests.md)
2932
- [Get Started Guide for Policy Integration Tests](policy-integration-tests-get-started.md)
3033
- [Global Configuration for Policy Integration Tests](policy-integration-tests-global-config.md)
@@ -83,7 +86,7 @@ The repository includes the following CI/CD pipelines and GitHub Actions workflo
8386
| Policy Exemptions | [Link](../.azuredevops/pipelines/policies/azure-pipelines-policy-exemptions.yml) | [Link](../.github/workflows/alz-policy-exemptions.yml) | Deploys Azure Policy exemptions based on environment-specific configuration files |
8487
| PR Validation Code Scan | [Link](../.azuredevops/pipelines/validation/azure-pipelines-pr-validation.yml) | [Link](../.github/workflows/pr-code-scan.yml) | Runs GitHub Super-Linter to validate code quality and syntax in pull requests |
8588
| PR Validation for Policy Assignment Consistency | [Link](../.azuredevops/pipelines/validation/azure-pipelines-pr-policy-assignment-env-consistency-tests.yml) | [Link](../.github/workflows/pr-policy-assignment-env-consistency.yml) | Validates that policy assignment configurations in development and production environments are consistent and do not contain unintended differences |
86-
| Policy Integration Tests | [link](../.azuredevops/pipelines/validation/azure-pipelines-pr-policy-int-tests.yml) | [link](../.github/workflows/policy-integration-tests.yml) | Tests assigned policies in Dev management group using real resources in Azure and validate the expected results |
89+
| Policy Integration Tests | [Link](../.azuredevops/pipelines/validation/azure-pipelines-pr-policy-int-tests.yml) | [Link](../.github/workflows/policy-integration-tests.yml) | Tests assigned policies in Dev management group using real resources in Azure and validate the expected results |
8790

8891

8992
## Configurations
@@ -128,7 +131,7 @@ flowchart TD
128131
deployPolicyInitiativeDev[Run Policy Initiative Pipeline / Workflow from Feature Branch]-->
129132
deployPolicyAssignmentDev[Run Policy Assignment Pipeline / Workflow from Feature Branch]-->
130133
deployPolicyExemptionDev[Run Policy Exemption Pipeline / Workflow from Feature Branch]-->
131-
manualRunIntTest[Manully run Policy Integration Tests if required]
134+
manualRunIntTest[Manually run Policy Integration Tests if required]
132135
style start fill:#28F906,stroke:#333,stroke-width:4px
133136
```
134137

docs/add-policy-resources.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ If the assignment is targeting a subscription, replace the `managementGroupId` p
110110

111111
If the assignment is targeting a resource group, remove the `managementGroupId` property and add `subscriptionId` and `resourceGroupName` properties and provide the target resource group name.
112112

113-
> :memo: NOTE: the Policy Assignment ADO pipeline and GitHub actions workflow will automatically populate the `nonComplianeceMessages` property based on assigned policies during the build stage / job. You do not need to provide any value for this property when creating the policy assignment configuration file.
113+
> :memo: NOTE: the Policy Assignment ADO pipeline and GitHub actions workflow will automatically populate the `nonComplianceMessages` property based on assigned policies during the build stage / job. You do not need to provide any value for this property when creating the policy assignment configuration file.
114114
115115
## Step 4: Add Policy Exemptions to the repository
116116

@@ -124,6 +124,7 @@ The configuration files must be aligned with the JSON schema file [policyExempti
124124
Example:
125125

126126
```json
127+
{
127128
"$schema": "../policyExemption.schema.json",
128129
"policyExemption": {
129130
"name": "pex-lz-corp-sub-eh-001",
@@ -157,6 +158,7 @@ Example:
157158
]
158159
},
159160
"subscriptionId": "0f1b7d98-c832-4d46-8a29-a0c63d54a2fa"
161+
}
160162
```
161163

162164
In the above example, the policy exemption is scoped to the subscription `0f1b7d98-c832-4d46-8a29-a0c63d54a2fa`.
@@ -172,7 +174,7 @@ This script has included the following tests based on the metadata property valu
172174
- Requester and Approver should be different people (`requestedBy` and `approvedBy` properties should have different value)
173175
- Exemption approved date should be a validate date in the past (`approvedOn` property value should be a valid date and should be less than the current date)
174176

175-
These tests are excluded by the Policy Exmemption ADO pipeline and GitHub actions workflow by default. You can enable them by removing the `ExcludeTag` filter in the Pester test task in the Test stages / jobs in the ADO pipeline and GitHub actions workflow.
177+
These tests are excluded by the Policy Exemption ADO pipeline and GitHub actions workflow by default. You can enable them by removing the `ExcludeTag` filter in the Pester test task in the Test stages / jobs in the ADO pipeline and GitHub actions workflow.
176178

177179
> :memo: NOTE: The Policy Exemption ADO pipeline and GitHub actions workflow evaluates the expiry date of each exemption based on the value from `expiresOn` property during the build stage / job. If the exemption is expired, the pipeline / workflow will automatically exclude the expired exemption from the deployment. However, this does not automatically remove the expired exemption from Azure.
178180

0 commit comments

Comments
 (0)