Skip to content

Commit 5e06154

Browse files
authored
Merge pull request #97037 from DCtheGeek/dmc-gov-mvccomp6
Update Policy for MVC compliance
2 parents ce5c97a + e279a03 commit 5e06154

File tree

9 files changed

+131
-72
lines changed

9 files changed

+131
-72
lines changed

articles/governance/policy/assign-policy-azurecli.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Quickstart: New policy assignment with Azure CLI"
33
description: In this quickstart, you use Azure CLI to create an Azure Policy assignment to identify non-compliant resources.
4-
ms.date: 01/23/2019
4+
ms.date: 11/25/2019
55
ms.topic: quickstart
66
---
77
# Quickstart: Create a policy assignment to identify non-compliant resources with Azure CLI
@@ -11,35 +11,37 @@ This quickstart steps you through the process of creating a policy assignment to
1111
machines that aren't using managed disks.
1212

1313
At the end of this process, you'll successfully identify virtual machines that aren't using managed
14-
disks. They're *non-compliant* with the policy assignment.
14+
disks. They're _non-compliant_ with the policy assignment.
1515

1616
Azure CLI is used to create and manage Azure resources from the command line or in scripts. This
1717
guide uses Azure CLI to create a policy assignment and to identify non-compliant resources in your
1818
Azure environment.
1919

20-
If you don't have an Azure subscription, create a [free](https://azure.microsoft.com/free/) account
21-
before you begin.
20+
## Prerequisites
2221

23-
[!INCLUDE [cloud-shell-try-it.md](../../../includes/cloud-shell-try-it.md)]
22+
- If you don't have an Azure subscription, create a [free](https://azure.microsoft.com/free/)
23+
account before you begin.
2424

25-
This quickstart requires that you run Azure CLI version 2.0.4 or later to install and use the CLI
26-
locally. To find the version, run `az --version`. If you need to install or upgrade, see [Install Azure CLI](/cli/azure/install-azure-cli).
25+
- This quickstart requires that you run Azure CLI version 2.0.76 or later to install and use the CLI
26+
locally. To find the version, run `az --version`. If you need to install or upgrade, see
27+
[Install Azure CLI](/cli/azure/install-azure-cli).
2728

28-
## Prerequisites
29+
- Register the Azure Policy Insights resource provider using Azure CLI. Registering the resource
30+
provider makes sure that your subscription works with it. To register a resource provider, you
31+
must have permission to the register resource provider operation. This operation is included in
32+
the Contributor and Owner roles. Run the following command to register the resource provider:
2933

30-
Register the Azure Policy Insights resource provider using Azure CLI. Registering the resource
31-
provider makes sure that your subscription works with it. To register a resource provider, you must
32-
have permission to the register resource provider operation. This operation is included in the
33-
Contributor and Owner roles. Run the following command to register the resource provider:
34+
```azurecli-interactive
35+
az provider register --namespace 'Microsoft.PolicyInsights'
36+
```
3437

35-
```azurecli-interactive
36-
az provider register --namespace 'Microsoft.PolicyInsights'
37-
```
38+
For more information about registering and viewing resource providers, see
39+
[Resource Providers and Types](../../azure-resource-manager/resource-manager-supported-services.md)
3840

39-
For more information about registering and viewing resource providers, see [Resource Providers and Types](../../azure-resource-manager/resource-manager-supported-services.md)
41+
- If you haven't already, install the [ARMClient](https://github.com/projectkudu/ARMClient). It's a
42+
tool that sends HTTP requests to Azure Resource Manager-based APIs.
4043

41-
If you haven't already, install the [ARMClient](https://github.com/projectkudu/ARMClient). It's a
42-
tool that sends HTTP requests to Azure Resource Manager-based APIs.
44+
[!INCLUDE [cloud-shell-try-it.md](../../../includes/cloud-shell-try-it.md)]
4345

4446
## Create a policy assignment
4547

@@ -55,11 +57,11 @@ az policy assignment create --name 'audit-vm-manageddisks' --display-name 'Audit
5557

5658
The preceding command uses the following information:
5759

58-
- **Name** - The actual name of the assignment. For this example, *audit-vm-manageddisks* was used.
59-
- **DisplayName** - Display name for the policy assignment. In this case, you're using *Audit VMs
60-
without managed disks Assignment*.
60+
- **Name** - The actual name of the assignment. For this example, _audit-vm-manageddisks_ was used.
61+
- **DisplayName** - Display name for the policy assignment. In this case, you're using _Audit VMs
62+
without managed disks Assignment_.
6163
- **Policy** – The policy definition ID, based on which you're using to create the assignment. In
62-
this case, it's the ID of policy definition *Audit VMs that do not use managed disks*. To get the
64+
this case, it's the ID of policy definition _Audit VMs that do not use managed disks_. To get the
6365
policy definition ID, run this command: `az policy definition list --query "[?displayName=='Audit VMs that do not use managed disks']"`
6466
- **Scope** - A scope determines what resources or grouping of resources the policy assignment gets
6567
enforced on. It could range from a subscription to resource groups. Be sure to replace
@@ -75,7 +77,8 @@ $policyAssignment = Get-AzPolicyAssignment | Where-Object { $_.Properties.Displa
7577
$policyAssignment.PolicyAssignmentId
7678
```
7779

78-
For more information about policy assignment IDs, see [Get-AzPolicyAssignment](/powershell/module/az.resources/get-azpolicyassignment).
80+
For more information about policy assignment IDs, see
81+
[Get-AzPolicyAssignment](/powershell/module/az.resources/get-azpolicyassignment).
7982

8083
Next, run the following command to get the resource IDs of the non-compliant resources that are
8184
output into a JSON file:

articles/governance/policy/assign-policy-portal.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Quickstart: New policy assignment with portal"
33
description: In this quickstart, you use Azure portal to create an Azure Policy assignment to identify non-compliant resources.
4-
ms.date: 12/06/2018
4+
ms.date: 11/25/2019
55
ms.topic: quickstart
66
---
77
# Quickstart: Create a policy assignment to identify non-compliant resources
@@ -11,15 +11,17 @@ This quickstart steps you through the process of creating a policy assignment to
1111
machines that aren't using managed disks.
1212

1313
At the end of this process, you'll successfully identify virtual machines that aren't using managed
14-
disks. They're *non-compliant* with the policy assignment.
14+
disks. They're _non-compliant_ with the policy assignment.
15+
16+
## Prerequisites
1517

1618
If you don't have an Azure subscription, create a [free](https://azure.microsoft.com/free/) account
1719
before you begin.
1820

1921
## Create a policy assignment
2022

21-
In this quickstart, you create a policy assignment and assign the *Audit VMs that do not use managed
22-
disks* policy definition.
23+
In this quickstart, you create a policy assignment and assign the _Audit VMs that do not use managed
24+
disks_ policy definition.
2325

2426
1. Launch the Azure Policy service in the Azure portal by clicking **All services**, then searching
2527
for and selecting **Policy**.
@@ -54,21 +56,23 @@ disks* policy definition.
5456

5557
For a partial list of available built-in policies, see [Azure Policy samples](./samples/index.md).
5658

57-
1. Search through the policy definitions list to find the *Audit VMs that do not use managed disks*
59+
1. Search through the policy definitions list to find the _Audit VMs that do not use managed disks_
5860
definition. Click on that policy and click **Select**.
5961

6062
![Find the correct policy definition](./media/assign-policy-portal/select-available-definition.png)
6163

6264
1. The **Assignment name** is automatically populated with the policy name you selected, but you can
63-
change it. For this example, leave *Audit VMs that do not use managed disks*. You can also add an
65+
change it. For this example, leave _Audit VMs that do not use managed disks_. You can also add an
6466
optional **Description**. The description provides details about this policy assignment.
6567
**Assigned by** will automatically fill based on who is logged in. This field is optional, so
6668
custom values can be entered.
6769

6870
1. Leave **Create a Managed Identity** unchecked. This box _must_ be checked when the policy or
69-
initiative includes a policy with the [deployIfNotExists](./concepts/effects.md#deployifnotexists)
70-
effect. As the policy used for this quickstart doesn't, leave it blank. For more information, see
71-
[managed identities](../../active-directory/managed-identities-azure-resources/overview.md) and [how remediation security works](./how-to/remediate-resources.md#how-remediation-security-works).
71+
initiative includes a policy with the
72+
[deployIfNotExists](./concepts/effects.md#deployifnotexists) effect. As the policy used for this
73+
quickstart doesn't, leave it blank. For more information, see
74+
[managed identities](../../active-directory/managed-identities-azure-resources/overview.md) and
75+
[how remediation security works](./how-to/remediate-resources.md#how-remediation-security-works).
7276

7377
1. Click **Assign**.
7478

@@ -110,7 +114,7 @@ To remove the assignment created, follow these steps:
110114
the **Audit VMs that do not use managed disks** policy assignment you created.
111115

112116
1. Right-click the **Audit VMs that do not use managed disks** policy assignment and select **Delete
113-
assignment**
117+
assignment**.
114118

115119
![Delete an assignment from the Compliance page](./media/assign-policy-portal/delete-assignment.png)
116120

articles/governance/policy/assign-policy-powershell.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
---
22
title: "Quickstart: New policy assignment with PowerShell"
33
description: In this quickstart, you use Azure PowerShell to create an Azure Policy assignment to identify non-compliant resources.
4-
ms.date: 03/11/2019
4+
ms.date: 11/25/2019
55
ms.topic: quickstart
66
---
77
# Quickstart: Create a policy assignment to identify non-compliant resources using Azure PowerShell
88

99
The first step in understanding compliance in Azure is to identify the status of your resources. In
1010
this quickstart, you create a policy assignment to identify virtual machines that aren't using
11-
managed disks. When complete, you'll identify virtual machines that are *non-compliant*.
11+
managed disks. When complete, you'll identify virtual machines that are _non-compliant_.
1212

1313
The Azure PowerShell module is used to manage Azure resources from the command line or in scripts.
1414
This guide explains how to use Az module to create a policy assignment.
1515

16-
If you don't have an Azure subscription, create a [free](https://azure.microsoft.com/free/) account
17-
before you begin.
18-
1916
## Prerequisites
2017

21-
- Before you start, make sure that the latest version of Azure PowerShell is installed. See [Install Azure PowerShell module](/powershell/azure/install-az-ps)
22-
for detailed information.
18+
- If you don't have an Azure subscription, create a [free](https://azure.microsoft.com/free/)
19+
account before you begin.
20+
21+
- Before you start, make sure that the latest version of Azure PowerShell is installed. See
22+
[Install Azure PowerShell module](/powershell/azure/install-az-ps) for detailed information.
23+
2324
- Register the Azure Policy Insights resource provider using Azure PowerShell. Registering the
2425
resource provider makes sure that your subscription works with it. To register a resource
2526
provider, you must have permission to the register resource provider operation. This operation is
@@ -31,11 +32,14 @@ before you begin.
3132
Register-AzResourceProvider -ProviderNamespace 'Microsoft.PolicyInsights'
3233
```
3334

34-
For more information about registering and viewing resource providers, see [Resource Providers and Types](../../azure-resource-manager/resource-manager-supported-services.md)
35+
For more information about registering and viewing resource providers, see
36+
[Resource Providers and Types](../../azure-resource-manager/resource-manager-supported-services.md).
37+
38+
[!INCLUDE [cloud-shell-try-it.md](../../../includes/cloud-shell-try-it.md)]
3539

3640
## Create a policy assignment
3741

38-
In this quickstart, you create a policy assignment for the *Audit VMs without managed disks*
42+
In this quickstart, you create a policy assignment for the _Audit VMs without managed disks_
3943
definition. This policy definition identifies virtual machines not using managed disks.
4044

4145
Run the following commands to create a new policy assignment:
@@ -53,11 +57,11 @@ New-AzPolicyAssignment -Name 'audit-vm-manageddisks' -DisplayName 'Audit VMs wit
5357

5458
The preceding commands use the following information:
5559

56-
- **Name** - The actual name of the assignment. For this example, *audit-vm-manageddisks* was used.
57-
- **DisplayName** - Display name for the policy assignment. In this case, you're using *Audit VMs
58-
without managed disks Assignment*.
60+
- **Name** - The actual name of the assignment. For this example, _audit-vm-manageddisks_ was used.
61+
- **DisplayName** - Display name for the policy assignment. In this case, you're using _Audit VMs
62+
without managed disks Assignment_.
5963
- **Definition** – The policy definition, based on which you're using to create the assignment. In
60-
this case, it's the ID of policy definition *Audit VMs that do not use managed disks*.
64+
this case, it's the ID of policy definition _Audit VMs that do not use managed disks_.
6165
- **Scope** - A scope determines what resources or grouping of resources the policy assignment gets
6266
enforced on. It could range from a subscription to resource groups. Be sure to replace
6367
<scope> with the name of your resource group.
@@ -75,7 +79,8 @@ you created. Run the following commands:
7579
Get-AzPolicyState -ResourceGroupName $rg.ResourceGroupName -PolicyAssignmentName 'audit-vm-manageddisks' -Filter 'IsCompliant eq false'
7680
```
7781

78-
For more information about getting policy state, see [Get-AzPolicyState](/powershell/module/az.policyinsights/Get-AzPolicyState).
82+
For more information about getting policy state, see
83+
[Get-AzPolicyState](/powershell/module/az.policyinsights/Get-AzPolicyState).
7984

8085
Your results resemble the following example:
8186

articles/governance/policy/assign-policy-template.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Quickstart: New policy assignment with templates"
33
description: In this quickstart, you use a Resource Manager template to create a policy assignment to identify non-compliant resources.
4-
ms.date: 03/13/2019
4+
ms.date: 11/25/2019
55
ms.topic: quickstart
66
---
77
# Quickstart: Create a policy assignment to identify non-compliant resources by using a Resource Manager template
@@ -11,15 +11,18 @@ This quickstart steps you through the process of creating a policy assignment to
1111
machines that aren't using managed disks.
1212

1313
At the end of this process, you'll successfully identify virtual machines that aren't using managed
14-
disks. They're *non-compliant* with the policy assignment.
14+
disks. They're _non-compliant_ with the policy assignment.
15+
16+
## Prerequisites
1517

1618
If you don't have an Azure subscription, create a [free](https://azure.microsoft.com/free/) account
1719
before you begin.
1820

1921
## Create a policy assignment
2022

2123
In this quickstart, you create a policy assignment and assign a built-in policy definition called
22-
*Audit VMs that do not use managed disks*. For a partial list of available built-in policies, see [Azure Policy samples](./samples/index.md).
24+
_Audit VMs that do not use managed disks_. For a partial list of available built-in policies, see
25+
[Azure Policy samples](./samples/index.md).
2326

2427
There are several methods for creating policy assignments. In this quickstart, you use a
2528
[quickstart template](https://azure.microsoft.com/resources/templates/101-azurepolicy-assign-builtinpolicy-resourcegroup/).
@@ -28,7 +31,8 @@ Here is a copy of the template:
2831
[!code-json[policy-assignment](~/quickstart-templates/101-azurepolicy-assign-builtinpolicy-resourcegroup/azuredeploy.json)]
2932

3033
> [!NOTE]
31-
> Azure Policy service is free. For more information, see [Overview of Azure Policy](./overview.md).
34+
> Azure Policy service is free. For more information, see
35+
> [Overview of Azure Policy](./overview.md).
3236
3337
1. Select the following image to sign in to the Azure portal and open the template:
3438

@@ -39,7 +43,7 @@ Here is a copy of the template:
3943
| Name | Value |
4044
|------|-------|
4145
| Subscription | Select your Azure subscription. |
42-
| Resource group | Select **Create new**, specify a name, and then select **OK**. In the screenshot, the resource group name is *mypolicyquickstart\<Date in MMDD>rg*. |
46+
| Resource group | Select **Create new**, specify a name, and then select **OK**. In the screenshot, the resource group name is _mypolicyquickstart\<Date in MMDD\>rg_. |
4347
| Location | Select a region. For example, **Central US**. |
4448
| Policy Assignment Name | Specify a policy assignment name. You can use the policy definition display if you want. For example, **Audit VMs that do not use managed disks**. |
4549
| Rg Name | Specify a resource group name where you want to assign the policy to. In this quickstart, use the default value **[resourceGroup().name]**. **[resourceGroup()](../../azure-resource-manager/resource-group-template-functions-resource.md#resourcegroup)** is a template function that retrieves the resource group. |
@@ -52,8 +56,10 @@ Some additional resources:
5256

5357
- To find more samples templates, see
5458
[Azure Quickstart template](https://azure.microsoft.com/resources/templates/?resourceType=Microsoft.Authorization&pageNumber=1&sort=Popular).
55-
- To see the template reference, go to [Azure template reference](/azure/templates/microsoft.authorization/allversions).
56-
- To learn how to develop Resource Manager templates, see [Azure Resource Manager documentation](/azure/azure-resource-manager/).
59+
- To see the template reference, go to
60+
[Azure template reference](/azure/templates/microsoft.authorization/allversions).
61+
- To learn how to develop Resource Manager templates, see
62+
[Azure Resource Manager documentation](../../azure-resource-manager/resource-group-overview.md).
5763
- To learn subscription-level deployment, see
5864
[Create resource groups and resources at the subscription level](../../azure-resource-manager/deploy-to-subscription.md).
5965

@@ -67,7 +73,8 @@ managed disks** policy assignment you created.
6773
If there are any existing resources that aren't compliant with this new assignment, they appear
6874
under **Non-compliant resources**.
6975

70-
For more information, see [How compliance works](./how-to/get-compliance-data.md#how-compliance-works).
76+
For more information, see
77+
[How compliance works](./how-to/get-compliance-data.md#how-compliance-works).
7178

7279
## Clean up resources
7380

articles/governance/policy/overview.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
title: Overview of Azure Policy
33
description: Azure Policy is a service in Azure, that you use to create, assign and, manage policy definitions in your Azure environment.
4-
ms.date: 11/21/2019
4+
ms.date: 11/25/2019
55
ms.topic: overview
66
---
7-
# Overview of the Azure Policy service
7+
# What is Azure Policy?
88

99
Governance validates that your organization can achieve its goals through effective and efficient
1010
use of IT. It meets this need by creating clarity between business goals and IT projects.
@@ -231,6 +231,4 @@ next steps:
231231

232232
- [Assign a policy definition using the portal](./assign-policy-portal.md).
233233
- [Assign a policy definition using the Azure CLI](./assign-policy-azurecli.md).
234-
- [Assign a policy definition using PowerShell](./assign-policy-powershell.md).
235-
- Review what a management group is with [Organize your resources with Azure management groups](../management-groups/overview.md).
236-
- View [Govern your Azure environment through Azure Policy](https://channel9.msdn.com/events/Build/2018/THR2030) on Channel 9.
234+
- [Assign a policy definition using PowerShell](./assign-policy-powershell.md).

articles/governance/policy/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
href: index.yml
33
- name: Overview
44
items:
5-
- name: Overview of Azure Policy
5+
- name: What is Azure Policy?
66
displayName: rbac, assign, initiative, parameters, count
77
href: overview.md
88
- name: Quickstarts

0 commit comments

Comments
 (0)