Skip to content

Commit 9eab482

Browse files
Update create-policy-definition.md
1 parent 468ace2 commit 9eab482

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

articles/governance/machine-configuration/how-to/create-policy-definition.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,19 @@ Parameters of the `New-GuestConfigurationPolicy` cmdlet:
105105
- **Description**: Policy description.
106106
- **Parameter**: Policy parameters provided in a hash table.
107107
- **PolicyVersion**: Policy version.
108-
- **Path**: Destination path where policy definitions are created.
108+
- **Path**: Destination path where policy definitions are created. This is NOT a path a local copy of the package.
109109
- **Platform**: Target platform (Windows/Linux) for machine configuration policy and content
110110
package.
111111
- **Mode**: (case sensitive: `ApplyAndMonitor`, `ApplyAndAutoCorrect`, `Audit`) choose if the policy should audit
112112
or deploy the configuration. The default is `Audit`.
113113
- **Tag** adds one or more tag filters to the policy definition
114114
- **Category** sets the category metadata field in the policy definition
115+
- **LocalContentPath** (Optional) - The path to the local copy of the `.zip` Machine Configuration package file (Required if you are using a User Assigned Managed Identity to provide access to an Azure Storge blob)
116+
- **ManagedIdentityResourceId** (Optional) - The resourceId of the User Assigned Managed Identity with read access to the Azure Storage blob containing the `.zip` Machine Configuration package file (Required if you are using a User Assigned Managed Identity to provide access to an Azure Storge blob)
117+
- **`-ExcludeArcMachines`** (Optional) - A flag to exclude Arc machines from the generated Policy definition (Required if you are using a User Assigned Managed Identity to provide access to an Azure Storge blob)
118+
119+
> [!IMPORTANT]
120+
> Please note that, unlike Azure VMs, Arc-connected machines currently do not support User Assigned Managed Identities. As a result, the `-ExcludeArcMachines` flag is required to ensure the exclusion of those machines from the policy definition.
115121
116122
For more information about the **Mode** parameter, see the page
117123
[How to configure remediation options for machine configuration][02].
@@ -132,8 +138,7 @@ $PolicyConfig = @{
132138
New-GuestConfigurationPolicy @PolicyConfig
133139
```
134140

135-
Create a policy definition that deploys a configuration using a custom configuration package, in a
136-
specified path:
141+
Create a policy definition that deploys a configuration using a custom configuration package with a User Assigned Managed Identity:
137142

138143
```powershell
139144
$PolicyConfig2 = @{
@@ -150,6 +155,25 @@ $PolicyConfig2 = @{
150155
New-GuestConfigurationPolicy @PolicyConfig2
151156
```
152157

158+
Create a policy definition that deploys a custom configuration package using a User Assigned Managed Identity:
159+
160+
```powershell
161+
$PolicyConfig3 = @{
162+
PolicyId = '_My GUID_'
163+
ContentUri = $contentUri
164+
DisplayName = 'My deployment policy'
165+
Description = 'My deployment policy'
166+
Path = './policies/deployIfNotExists.json'
167+
Platform = 'Windows'
168+
PolicyVersion = 1.0.0
169+
Mode = 'ApplyAndAutoCorrect'
170+
contentLocalPath = "C:\Local\Path\To\Package"
171+
managedIdentityResourceId = "YourManagedIdentityResourceId"
172+
}
173+
174+
New-GuestConfigurationPolicy @PolicyConfig3 -ExcludeArcMachines
175+
```
176+
153177
The cmdlet output returns an object containing the definition display name and path of the policy
154178
files. Definition JSON files that create audit policy definitions have the name
155179
`auditIfNotExists.json` and files that create policy definitions to apply configurations have the

0 commit comments

Comments
 (0)