Skip to content

Commit 27e18e9

Browse files
authored
Merge pull request #233248 from GitHubber17/refresh-79519-guest-config
Freshness Pass for User Story: 79519
2 parents 8670c40 + ef35f79 commit 27e18e9

File tree

1 file changed

+62
-85
lines changed

1 file changed

+62
-85
lines changed
Lines changed: 62 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,95 @@
11
---
2-
title: Guest configuration extension
3-
description: Learn about the extension used to audit / configure settings inside virtual machines
2+
title: Azure Automanage machine configuration (guest configuration)
3+
description: Learn about the machine configuration extension feature of Azure Automanage, and audit and configure settings for Azure virtual machines.
44
ms.topic: article
55
ms.service: virtual-machines
66
ms.subservice: extensions
77
author: mgreenegit
88
ms.author: migreene
9-
ms.date: 04/15/2021
9+
ms.date: 04/05/2023
1010
---
1111

12-
# Overview of the guest configuration extension
12+
# Azure Automanage machine configuration extension
1313

14-
The Guest Configuration extension is a component of Azure Policy that performs audit and configuration operations inside virtual machines.
15-
Policies such as security baseline definitions for
16-
[Linux](https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2Fproviders%2FMicrosoft.Authorization%2FpolicyDefinitions%2Ffc9b3da7-8347-4380-8e70-0a0361d8dedd)
17-
and [Windows](https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2Fproviders%2FMicrosoft.Authorization%2FpolicyDefinitions%2F72650e9f-97bc-4b2a-ab5f-9781a9fcecbc)
18-
can't check settings inside machines until the extension is installed.
14+
The machine configuration extension is a feature of Azure Automanage that performs audit and configuration operations inside virtual machines (VMs).
15+
16+
To check policies inside VMs, such as Azure compute security baseline definitions for [Linux](https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2Fproviders%2FMicrosoft.Authorization%2FpolicyDefinitions%2Ffc9b3da7-8347-4380-8e70-0a0361d8dedd) and [Windows](https://portal.azure.com/#blade/Microsoft_Azure_Policy/PolicyDetailBlade/definitionId/%2Fproviders%2FMicrosoft.Authorization%2FpolicyDefinitions%2F72650e9f-97bc-4b2a-ab5f-9781a9fcecbc), the machine configuration extension must be installed.
1917

2018
## Prerequisites
2119

22-
For the machine to authenticate to the Guest Configuration service, the machine must have a
23-
[System-Assigned Managed Identity](../../active-directory/managed-identities-azure-resources/overview.md).
24-
The identity requirement on a virtual machine is met if the following property is set.
20+
To enable your VM to authenticate to the machine configuration service, your VM must have a [system-assigned managed identity](/azure/active-directory/managed-identities-azure-resources/overview). You can satisfy the identity requirement for your VM by setting the `"type": "SystemAssigned"` property:
2521

26-
```json
27-
"identity": {
28-
"type": "SystemAssigned"
29-
}
30-
```
22+
```json
23+
"identity": {
24+
"type": "SystemAssigned"
25+
}
26+
```
3127

32-
### Operating Systems
28+
### Operating systems
3329

34-
Support for the Guest Configuration extension is the same as operating system support
35-
[documented for the end to end solution](../../governance/machine-configuration/overview.md#supported-client-types).
30+
Operating system support for the machine configuration extension is the same as documented [operating system support for the end-to-end solution](/azure/governance/machine-configuration/overview#supported-client-types).
3631

3732
### Internet connectivity
3833

39-
The agent installed by the Guest Configuration extension must be able to reach
40-
content packages listed by Guest Configuration assignments,
41-
and report status to the Guest Configuration service.
42-
The machine can connect using outbound HTTPS over
43-
TCP port 443, or if a connection is provided through private networking.
34+
The agent installed by the machine configuration extension must be able to reach content packages listed by guest configuration assignments,
35+
and report status to the machine configuration service. The VM can connect by using outbound HTTPS over TCP port 443, or a connection provided through private networking.
36+
4437
To learn more about private networking, see the following articles:
4538

46-
- [Guest Configuration, communicate over private link in Azure](../../governance/machine-configuration/overview.md#communicate-over-private-link-in-azure)
47-
- [Use private endpoints for Azure Storage](../../storage/common/storage-private-endpoints.md)
39+
- [Azure Automanage machine configuration, Communicate over Azure Private Link](/azure/governance/machine-configuration/overview#communicate-over-private-link-in-azure)
40+
- [Use private endpoints for Azure Storage](/azure/storage/common/storage-private-endpoints)
4841

49-
## How can I install the extension?
42+
## Install the extension
5043

51-
The instance name of the extension must be set to
52-
"AzurePolicyforWindows" or "AzurePolicyforLinux",
53-
because the policies referenced above require these specific strings.
44+
You can install and deploy the machine configuration extension directly from the Azure CLI or PowerShell. Deployment templates are also available for Azure Resource Manager (ARM), Bicep, and Terraform. For deployment template details, see [Microsoft.GuestConfiguration guestConfigurationAssignments](/azure/templates/microsoft.guestconfiguration/guestconfigurationassignments?pivots=deployment-language-arm-template).
5445

55-
By default, all deployments update to the latest version. The value
56-
of property _autoUpgradeMinorVersion_ defaults to "true" unless it is otherwise
57-
specified. You do not need to worry about updating your code when
58-
new versions of the extension are released.
46+
> [!NOTE]
47+
> In the following deployment examples, replace `<placeholder>` parameter values with specific values for your configuration.
5948
60-
## Automatic upgrade
49+
### Deployment considerations
6150

62-
The guest configuration extension supports property `enableAutomaticUpgrade`. When this
63-
property is set to `true`, Azure will automatically upgrade to the latest version
64-
of the extension as future releases become available. For more information, see the page
65-
[Automatic Extension Upgrade for VMs and Scale Sets in Azure](../automatic-extension-upgrade.md)
51+
Before you install and deploy the machine configuration extension, review the following considerations.
6652

67-
### Azure Policy
53+
- **Instance name**. When you install the machine configuration extension, the instance name of the extension must be set to `AzurePolicyforWindows` or `AzurePolicyforLinux`. The security baseline definition policies described earlier require these specific strings.
6854

69-
To deploy the latest version of the extension at scale including identity requirements,
70-
[assign](../../governance/policy/assign-policy-portal.md) the Azure Policy:
55+
- **Versions**. By default, all deployments update to the latest version. The value of the `autoUpgradeMinorVersion` property defaults to `true` unless otherwise specified. This feature helps to alleviate concerns about updating your code when new versions of the machine configuration extension are released.
7156

72-
[Deploy prerequisites to enable Guest Configuration policies on virtual machines](https://github.com/Azure/azure-policy/blob/master/built-in-policies/policySetDefinitions/Guest%20Configuration/GuestConfiguration_Prerequisites.json).
57+
- **Automatic upgrade**. The machine configuration extension supports the `enableAutomaticUpgrade` property. When this property is set to `true`, Azure automatically upgrades to the latest version of the extension as future releases become available. For more information, see [Automatic Extension Upgrade for VMs and Virtual Machine Scale Sets in Azure](/azure/virtual-machines/automatic-extension-upgrade).
58+
59+
- **Azure Policy**. To deploy the latest version of the machine configuration extension at scale including identity requirements, follow the steps in [Create a policy assignment to identify noncompliant resources](/azure/governance/policy/assign-policy-portal#create-a-policy-assignment). Create the following assignment with Azure Policy:
60+
- [Deploy prerequisites to enable Guest Configuration policies on virtual machines](https://github.com/Azure/azure-policy/blob/master/built-in-policies/policySetDefinitions/Guest%20Configuration/GuestConfiguration_Prerequisites.json)
61+
62+
- **Other properties**. You don't need to include any settings or protected-settings properties on the machine configuration extension. The agent retrieves this class of information from the Azure REST API [Guest Configuration assignment](/rest/api/guestconfiguration/guestconfigurationassignments) resources. For example, the [`ConfigurationUri`](/rest/api/guestconfiguration/guestconfigurationassignments/createorupdate#guestconfigurationnavigation), [`Mode`](/rest/api/guestconfiguration/guestconfigurationassignments/createorupdate#configurationmode), and [`ConfigurationSetting`](/rest/api/guestconfiguration/guestconfigurationassignments/createorupdate#configurationsetting) properties are each managed per-configuration rather than on the VM extension.
7363

7464
### Azure CLI
7565

7666
To deploy the extension for Linux:
7767

78-
7968
```azurecli
80-
az vm extension set --publisher Microsoft.GuestConfiguration --name ConfigurationforLinux --extension-instance-name AzurePolicyforLinux --resource-group myResourceGroup --vm-name myVM --enable-auto-upgrade true
69+
az vm extension set --publisher Microsoft.GuestConfiguration --name ConfigurationForLinux --extension-instance-name AzurePolicyforLinux --resource-group <myResourceGroup> --vm-name <myVM> --enable-auto-upgrade true
8170
```
8271

8372
To deploy the extension for Windows:
8473

8574
```azurecli
86-
az vm extension set --publisher Microsoft.GuestConfiguration --name ConfigurationforWindows --extension-instance-name AzurePolicyforWindows --resource-group myResourceGroup --vm-name myVM --enable-auto-upgrade true
75+
az vm extension set --publisher Microsoft.GuestConfiguration --name ConfigurationforWindows --extension-instance-name AzurePolicyforWindows --resource-group <myResourceGroup> --vm-name <myVM> --enable-auto-upgrade true
8776
```
8877

8978
### PowerShell
9079

9180
To deploy the extension for Linux:
9281

9382
```powershell
94-
Set-AzVMExtension -Publisher 'Microsoft.GuestConfiguration' -Type 'ConfigurationforLinux' -Name 'AzurePolicyforLinux' -TypeHandlerVersion 1.0 -ResourceGroupName 'myResourceGroup' -Location 'myLocation' -VMName 'myVM' -EnableAutomaticUpgrade $true
83+
Set-AzVMExtension -Publisher 'Microsoft.GuestConfiguration' -ExtensionType 'ConfigurationForLinux' -Name 'AzurePolicyforLinux' -TypeHandlerVersion 1.0 -ResourceGroupName '<myResourceGroup>' -Location '<myLocation>' -VMName '<myVM>' -EnableAutomaticUpgrade $true
9584
```
9685

9786
To deploy the extension for Windows:
9887

9988
```powershell
100-
Set-AzVMExtension -Publisher 'Microsoft.GuestConfiguration' -Type 'ConfigurationforWindows' -Name 'AzurePolicyforWindows' -TypeHandlerVersion 1.0 -ResourceGroupName 'myResourceGroup' -Location 'myLocation' -VMName 'myVM' -EnableAutomaticUpgrade $true
89+
Set-AzVMExtension -Publisher 'Microsoft.GuestConfiguration' -ExtensionType 'ConfigurationforWindows' -Name 'AzurePolicyforWindows' -TypeHandlerVersion 1.0 -ResourceGroupName '<myResourceGroup>' -Location '<myLocation>' -VMName '<myVM>' -EnableAutomaticUpgrade $true
10190
```
10291

103-
### Resource Manager template
92+
### ARM template
10493

10594
To deploy the extension for Linux:
10695

@@ -115,7 +104,7 @@ To deploy the extension for Linux:
115104
],
116105
"properties": {
117106
"publisher": "Microsoft.GuestConfiguration",
118-
"type": "ConfigurationforLinux",
107+
"type": "ConfigurationForLinux",
119108
"typeHandlerVersion": "1.0",
120109
"autoUpgradeMinorVersion": true,
121110
"enableAutomaticUpgrade": true, 
@@ -148,7 +137,7 @@ To deploy the extension for Windows:
148137
}
149138
```
150139

151-
### Bicep
140+
### Bicep template
152141

153142
To deploy the extension for Linux:
154143

@@ -162,7 +151,7 @@ resource windowsVMGuestConfigExtension 'Microsoft.Compute/virtualMachines/extens
162151
location: resourceGroup().location
163152
properties: {
164153
publisher: 'Microsoft.GuestConfiguration'
165-
type: 'ConfigurationforLinux'
154+
type: 'ConfigurationForLinux'
166155
typeHandlerVersion: '1.0'
167156
autoUpgradeMinorVersion: true
168157
enableAutomaticUpgrade: true
@@ -194,16 +183,16 @@ resource windowsVMGuestConfigExtension 'Microsoft.Compute/virtualMachines/extens
194183
}
195184
```
196185

197-
### Terraform
186+
### Terraform template
198187

199188
To deploy the extension for Linux:
200189

201190
```terraform
202191
resource "azurerm_virtual_machine_extension" "gc" {
203192
name = "AzurePolicyforLinux"
204-
virtual_machine_id = "myVMID"
193+
virtual_machine_id = "<myVMID>"
205194
publisher = "Microsoft.GuestConfiguration"
206-
type = "ConfigurationforLinux"
195+
type = "ConfigurationForLinux"
207196
type_handler_version = "1.0"
208197
auto_upgrade_minor_version = "true"
209198
}
@@ -214,44 +203,32 @@ To deploy the extension for Windows:
214203
```terraform
215204
resource "azurerm_virtual_machine_extension" "gc" {
216205
name = "AzurePolicyforWindows"
217-
virtual_machine_id = "myVMID"
206+
virtual_machine_id = "<myVMID>"
218207
publisher = "Microsoft.GuestConfiguration"
219208
type = "ConfigurationforWindows"
220209
type_handler_version = "1.0"
221210
auto_upgrade_minor_version = "true"
222211
}
223212
```
224213

225-
## Settings
226-
227-
There's no need to include any settings or protected-settings properties on the extension.
228-
All such information is retrieved by the agent from
229-
[Guest Configuration assignment](/rest/api/guestconfiguration/guestconfigurationassignments)
230-
resources. For example, the
231-
[ConfigurationUri](/rest/api/guestconfiguration/guestconfigurationassignments/createorupdate#guestconfigurationnavigation),
232-
[Mode](/rest/api/guestconfiguration/guestconfigurationassignments/createorupdate#configurationmode),
233-
and
234-
[ConfigurationSetting](/rest/api/guestconfiguration/guestconfigurationassignments/createorupdate#configurationsetting)
235-
properties are each managed per-configuration rather than on the VM extension.
236-
237-
## Guest Configuration resource provider error codes
214+
## Error messages
238215

239-
See below for a list of the possible error messages when enabling the extension
216+
The following table lists possible error messages related to enabling the Guest Configuration extension.
240217

241-
|Error Code|Description|
242-
|-|-|
243-
|NoComplianceReport|VM has not reported the compliance data.|
244-
|GCExtensionMissing|Guest Configuration extension is missing.|
245-
|ManagedIdentityMissing|Managed identity is missing.|
246-
|UserIdentityMissing|User assigned identity is missing.|
247-
|GCExtensionManagedIdentityMissing|Guest Configuration extension and managed identity is missing.|
248-
|GCExtensionUserIdentityMissing|Guest Configuration extension and user identity is missing.|
249-
|GCExtensionIdentityMissing|Guest Configuration extension, managed identity and user identity are missing.|
218+
| Error code | Description |
219+
|---|---|
220+
| **NoComplianceReport** | The VM hasn't reported the compliance data. |
221+
| **GCExtensionMissing** | The machine configuration (guest configuration) extension is missing. |
222+
| **ManagedIdentityMissing** | The managed identity is missing. |
223+
| **UserIdentityMissing** | The user-assigned identity is missing. |
224+
| **GCExtensionManagedIdentityMissing** | The machine configuration (guest configuration) extension and managed identity are missing. |
225+
| **GCExtensionUserIdentityMissing** | The machine configuration (guest configuration) extension and user-assigned identity are missing. |
226+
| **GCExtensionIdentityMissing** | The machine configuration (guest configuration) extension, managed identity, and user-assigned identity are missing. |
250227

251228
## Next steps
252229

253-
* For more information about Azure Policy's guest configuration, see [Understand Azure Policy's Guest Configuration](../../governance/machine-configuration/overview.md)
254-
* For more information about how the Linux Agent and extensions work, see [Azure VM extensions and features for Linux](features-linux.md).
255-
* For more information about how the Windows Guest Agent and extensions work, see [Azure VM extensions and features for Windows](features-windows.md).
256-
* To install the Windows Guest Agent, see [Azure Windows Virtual Machine Agent Overview](agent-windows.md).
257-
* To install the Linux Agent, see [Azure Linux Virtual Machine Agent Overview](agent-linux.md).
230+
- For more information about the machine configuration extension, see [Understand the machine configuration feature of Azure Automanage](/azure/governance/machine-configuration/overview).
231+
- For more information about how the Linux Agent and extensions work, see [Virtual machine extensions and features for Linux](features-linux.md).
232+
- For more information about how the Windows Guest Agent and extensions work, see [Virtual machine extensions and features for Windows](features-windows.md).
233+
- To install the Windows Guest Agent, see [Azure Virtual Machine Agent overview](agent-windows.md).
234+
- To install the Linux Agent, see [Understanding and using the Azure Linux Agent](agent-linux.md).

0 commit comments

Comments
 (0)