Skip to content

Commit 7f33bda

Browse files
Patrick El-AzemSnehaGunda
andauthored
Apply suggestions from code review
Co-authored-by: Sneha Gunda <[email protected]>
1 parent 9a5aec7 commit 7f33bda

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

articles/cosmos-db/policy.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Azure Policy and Cosmos DB
3-
description: This article describes how to use Azure Policy to implement governance and controls for Cosmos DB resources.
2+
title: Use Azure Policy to implement governance and controls for Azure Cosmos DB resources
3+
description: Learn how to use Azure Policy to implement governance and controls for Cosmos DB resources.
44
author: plzm
55
ms.author: paelaz
66
ms.service: cosmos-db
@@ -9,54 +9,54 @@ ms.date: 05/20/2020
99

1010
---
1111

12-
# Azure Policy Overview
12+
# Use Azure Policy to implement governance and controls for Azure Cosmos DB resources
1313

1414
[Azure Policy](../governance/policy/overview.md) helps to enforce organizational governance standards, assess resource compliance, and implement automatic remediation. Common use cases include security, cost management, and configuration consistency.
1515

16-
Azure Policy provides built-in policy definitions. Custom policy definitions can be created for scenarios not addressed by built-in policy definitions. Consult [Azure Policy documentation](../governance/policy/overview.md) for specifics.
16+
Azure Policy provides built-in policy definitions. You can create custom policy definitions for scenarios that are not addressed by the built-in policy definitions. See the [Azure Policy documentation](../governance/policy/overview.md) for more details.
1717

18-
## Assigning a Built-in Policy Definition
18+
## Assign a built-in policy definition
1919

20-
Policy _assignments_ are created from policy _definitions_. Built-in or custom policy definitions can be used. Assignments are scoped to an Azure management group, an Azure subscription, or a resource group and will apply to resources within the scope. Optionally, specific resources can be excluded from the scope.
20+
Policy definitions describe resource compliance conditions and the effect to take if a condition is met. Policy _assignments_ are created from policy _definitions_. You can use built-in or custom policy definitions for your Azure Cosmos DB resources. Policy assignments are scoped to an Azure management group, an Azure subscription, or a resource group and they are applied to the resources within the selected scope. Optionally, you can exclude specific resources from the scope.
2121

22-
Policy assignments can be created with the [Azure portal](../governance/policy/assign-policy-portal.md), [Azure PowerShell](../governance/policy/assign-policy-powershell.md), [Azure CLI](../governance/policy/assign-policy-azurecli.md), or [ARM template](../governance/policy/assign-policy-template.md).
22+
You can create policy assignments with the [Azure portal](../governance/policy/assign-policy-portal.md), [Azure PowerShell](../governance/policy/assign-policy-powershell.md), [Azure CLI](../governance/policy/assign-policy-azurecli.md), or [ARM template](../governance/policy/assign-policy-template.md).
2323

24-
To create a policy assignment from a built-in policy definition for Cosmos DB, follow the steps to [create a policy assignment with the Azure portal](../governance/policy/assign-policy-portal.md).
24+
To create a policy assignment from a built-in policy definition for Azure Cosmos DB, use the steps in [create a policy assignment with the Azure portal](../governance/policy/assign-policy-portal.md) article.
2525

26-
At the step to select a policy definition, enter `Cosmos DB` in the Search field to filter the list of available built-in policy definitions. Select one of the available built-in policy definitions, then the **Select** button to continue with policy assignment creation.
26+
At the step to select a policy definition, enter `Cosmos DB` in the Search field to filter the list of available built-in policy definitions. Select one of the available built-in policy definitions, and then choose **Select** to continue creating the policy assignment.
2727

2828
> [!TIP]
29-
> The built-in policy definition names shown on **Available Definitions** can also be used with Azure PowerShell, Azure CLI, or ARM templates to create policy assignments.
29+
> You can also use the built-in policy definition names shown in the **Available Definitions** pane with Azure PowerShell, Azure CLI, or ARM templates to create policy assignments.
3030
3131
:::image type="content" source="./media/policy/available-definitions.png" alt-text="Search for Cosmos DB built-in policy definitions":::
3232

33-
## Creating a Custom Policy Definition
33+
## Create a custom policy definition
3434

35-
For specific scenarios not addressed by built-in policies, [a custom policy definition can be created](../governance/policy/tutorials/create-custom-policy-definition). Policy _assignments_ can be created from either built-in or custom policy _definitions_.
35+
For specific scenarios that are not addressed by built-in policies, you can create [a custom policy definition](../governance/policy/tutorials/create-custom-policy-definition.md). Later you create a Policy _assignment_ from your custom policy _definition_.
3636

3737
### Property Types and Property Aliases in Policy Rules
3838

39-
The [custom policy definition steps](../governance/policy/tutorials/create-custom-policy-definition) include identifying resource properties and property aliases, which are needed to create policy rules.
39+
Use the [custom policy definition steps](../governance/policy/tutorials/create-custom-policy-definition) to identify the resource properties and property aliases, which are required to create policy rules.
4040

41-
To identify Cosmos DB property aliases, use the namespace `Microsoft.DocumentDB` with one of the methods shown in the custom policy definition steps.
41+
To identify Azure Cosmos DB specific property aliases, use the namespace `Microsoft.DocumentDB` with one of the methods shown in the custom policy definition steps article.
4242

43-
#### Using the Azure CLI:
43+
#### Use the Azure CLI:
4444
```azurecli-interactive
4545
# Login first with az login if not using Cloud Shell
4646
4747
# Get Azure Policy aliases for namespace Microsoft.DocumentDB
4848
az provider show --namespace Microsoft.DocumentDB --expand "resourceTypes/aliases" --query "resourceTypes[].aliases[].name"
4949
```
5050

51-
#### Using Azure PowerShell:
51+
#### Use Azure PowerShell:
5252
```azurepowershell-interactive
5353
# Login first with Connect-AzAccount if not using Cloud Shell
5454
5555
# Use Get-AzPolicyAlias to list aliases for Microsoft.DocumentDB namespace
5656
(Get-AzPolicyAlias -NamespaceMatch 'Microsoft.DocumentDB').Aliases
5757
```
5858

59-
The output of listing Cosmos DB property aliases using one of the methods described above is a list of property alias names. Partial sample Cosmos DB output:
59+
These commands output the list of property alias names for Azure Cosmos DB property. The following is an excerpt from the output:
6060

6161
```json
6262
[
@@ -73,9 +73,9 @@ The output of listing Cosmos DB property aliases using one of the methods descri
7373
]
7474
```
7575

76-
Any of these property alias names can be used in [custom policy definition rules](../governance/policy/tutorials/create-custom-policy-definition#policy-rule).
76+
You can use any of these property alias names in the [custom policy definition rules](../governance/policy/tutorials/create-custom-policy-definition.md#policy-rule).
7777

78-
An example policy can check if a Cosmos DB SQL database's provisioned throughput is greater than a maximum allowable limit of 400 RU/s. A custom policy definition would include two rules: one to check for the specific type to check, and one for the specific property of the type. Both rules would use alias names.
78+
The following is an example policy definition that checks if an Azure Cosmos DB SQL database's provisioned throughput is greater than a maximum allowed limit of 400 RU/s. A custom policy definition includes two rules: one to check for the specific type of property alias, and the second one for the specific property of the type. Both rules use the alias names.
7979

8080
```json
8181
"policyRule": {
@@ -94,26 +94,26 @@ An example policy can check if a Cosmos DB SQL database's provisioned throughput
9494
}
9595
```
9696

97-
Built-in and custom policy definitions can be used similarly to create policy assignments.
97+
Custom policy definitions can be used to create policy assignments just like the built-in policy definitions are used.
9898

99-
## Policy Compliance
99+
## Policy compliance
100100

101-
After policy assignments are created, Azure Policy evaluates the resources in the assignment's scope. Each resource's _compliance_ with the policy is assessed. The _effect_ specified in the policy is then applied to non-compliant resources.
101+
After the policy assignments are created, Azure Policy evaluates the resources in the assignment's scope. Each resource's _compliance_ with the policy is assessed. The _effect_ specified in the policy is then applied to non-compliant resources.
102102

103-
Compliance results and remediation details can be reviewed in the [Azure portal](../governance/policy/how-to/get-compliance-data#portal) or via the [Azure CLI](../governance/policy/how-to/get-compliance-data#command-line) or [Azure Monitor logs](../governance/policy/how-to/get-compliance-data#azure-monitor-logs).
103+
You can review the compliance results and remediation details in the [Azure portal](../governance/policy/how-to/get-compliance-data.md#portal) or via the [Azure CLI](../governance/policy/how-to/get-compliance-data.md#command-line) or the [Azure Monitor logs](../governance/policy/how-to/get-compliance-data.md#azure-monitor-logs).
104104

105-
Two example policy assignments are shown. One assignment, based on a built-in policy definition, checks that Azure Cosmos DB resources are deployed only to allowed Azure regions. The other assignment is based on a custom policy definition. This assignment checks that provisioned throughput on Azure Cosmos DB resources does not exceed a specified maximum.
105+
The following screenshot shows two example policy assignments. One assignment is based on a built-in policy definition, which checks that the Azure Cosmos DB resources are deployed only to the allowed Azure regions. The other assignment is based on a custom policy definition. This assignment checks that the provisioned throughput on Azure Cosmos DB resources does not exceed a specified maximum limit.
106106

107-
After the policy assignments were deployed, the compliance dashboard shows evaluation results. Note that this can take up to 30 minutes after policy assignment deployment.
107+
After the policy assignments are deployed, the compliance dashboard shows evaluation results. Note that this can take up to 30 minutes after deploying a policy assignment.
108108

109109
The screenshot shows the following compliance evaluation results:
110110

111-
- Zero of one Azure Cosmos DB accounts in scope are compliant with the policy assignment to check that resources were deployed to allowed regions
112-
- One of two Azure Cosmos DB database or collection resources in scope are compliant with the policy assignment to check for provisioned throughput exceeding the specified maximum
111+
- Zero out of one Azure Cosmos DB accounts in the specified scope are compliant with the policy assignment to check that resources were deployed to allowed regions.
112+
- One out of two Azure Cosmos DB database or collection resources in the specified scope are compliant with the policy assignment to check for provisioned throughput exceeding the specified maximum limit.
113113

114114
:::image type="content" source="./media/policy/compliance.png" alt-text="Search for Cosmos DB built-in policy definitions":::
115115

116-
Non-compliant resources can be [remediated with Azure Policy](../governance/policy/how-to/remediate-resources).
116+
To remediate the non-compliant resources, see the [remediated with Azure Policy](../governance/policy/how-to/remediate-resources) article.
117117

118118
## Next Steps
119119

0 commit comments

Comments
 (0)