You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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:
29
33
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
+
```
34
37
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)
38
40
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.
40
43
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.
Copy file name to clipboardExpand all lines: articles/governance/policy/assign-policy-powershell.md
+19-14Lines changed: 19 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,26 @@
1
1
---
2
2
title: "Quickstart: New policy assignment with PowerShell"
3
3
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
5
5
ms.topic: quickstart
6
6
---
7
7
# Quickstart: Create a policy assignment to identify non-compliant resources using Azure PowerShell
8
8
9
9
The first step in understanding compliance in Azure is to identify the status of your resources. In
10
10
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_.
12
12
13
13
The Azure PowerShell module is used to manage Azure resources from the command line or in scripts.
14
14
This guide explains how to use Az module to create a policy assignment.
15
15
16
-
If you don't have an Azure subscription, create a [free](https://azure.microsoft.com/free/) account
17
-
before you begin.
18
-
19
16
## Prerequisites
20
17
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
+
23
24
- Register the Azure Policy Insights resource provider using Azure PowerShell. Registering the
24
25
resource provider makes sure that your subscription works with it. To register a resource
25
26
provider, you must have permission to the register resource provider operation. This operation is
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).
> 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).
32
36
33
37
1. Select the following image to sign in to the Azure portal and open the template:
34
38
@@ -39,7 +43,7 @@ Here is a copy of the template:
39
43
| Name | Value |
40
44
|------|-------|
41
45
| 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_. |
43
47
| Location | Select a region. For example, **Central US**. |
44
48
| 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**. |
45
49
| 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. |
0 commit comments