Skip to content

Commit aeaa66f

Browse files
Merge pull request #231656 from SnehaSudhirG/21Mar-UMCDocUpdate
edited the info in update deployment and update assessment
2 parents 9b047b3 + e685031 commit aeaa66f

File tree

2 files changed

+22
-74
lines changed

2 files changed

+22
-74
lines changed

articles/update-center/manage-arc-enabled-servers-programmatically.md

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This article tells how to use Update management center (preview) us
44
ms.service: update-management-center
55
author: SnehaSudhirG
66
ms.author: sudhirsneha
7-
ms.date: 02/20/2023
7+
ms.date: 03/31/2023
88
ms.topic: conceptual
99
---
1010

@@ -21,7 +21,7 @@ Support for Azure REST API to manage Azure Arc-enabled servers is available thro
2121
To trigger an update assessment on your Azure Arc-enabled server, specify the following POST request:
2222

2323
```rest
24-
POST on `subscriptions/subscriptionId/resourceGroups/resourceGroupName/provider/Microsoft.HybridCompute/machines/machineName/assessPatches?api-version=2020-08-15-preview`
24+
POST on `subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridCompute/machines/machineName/assessPatches?api-version=2020-08-15-preview`
2525
{
2626
}
2727
```
@@ -31,7 +31,7 @@ POST on `subscriptions/subscriptionId/resourceGroups/resourceGroupName/provider/
3131
To specify the POST request, you can use the Azure CLI [az rest](/cli/azure/reference-index#az_rest) command.
3232

3333
```azurecli
34-
az rest --method post --url https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroupName/provider/Microsoft.HybridCompute/machines/machineName/assessPatches?api-version=2020-08-15-preview --body @body.json
34+
az rest --method post --url https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridCompute/machines/machineName/assessPatches?api-version=2020-08-15-preview --body @body.json
3535
```
3636

3737
The format of the request body for version 2020-08-15 is as follows:
@@ -43,28 +43,21 @@ The format of the request body for version 2020-08-15 is as follows:
4343

4444
# [Azure PowerShell](#tab/powershell)
4545

46-
To specify the POST request, you can use the Azure PowerShell [Invoke-AzRestMethod](/powershell/module/az.accounts/invoke-azrestmethod) cmdlet.
46+
To specify the POST request, you can use the Azure PowerShell [Invoke-AzRestMethod-Path](/powershell/module/az.accounts/invoke-azrestmethod) cmdlet.
4747

4848
```azurepowershell
49-
Invoke-AzRestMethod
50-
-ResourceGroupName resourceGroupName
51-
-Name "machineName"
52-
-ResourceProviderName "Microsoft.HybridCompute"
53-
-ResourceType "machines"
54-
-ApiVersion 2020-08-15-preview
55-
-Payload '{
56-
}'
57-
-Method POST
49+
Invoke-AzRestMethod-Path
50+
"/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.HybridCompute/machines/machinename/assessPatches?api-version=2020-08-15-preview"
51+
-Payload '{}' -Method POST
5852
```
59-
6053
---
6154

6255
## Update deployment
6356

6457
To trigger an update deployment to your Azure Arc-enabled server, specify the following POST request:
6558

6659
```rest
67-
POST on `subscriptions/subscriptionId/resourceGroups/resourceGroupName/provider/Microsoft.HybridCompute/machines/machineName/installPatches?api-version=2020-08-15-preview`
60+
POST on `subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.HybridCompute/machines/machineName/installPatches?api-version=2020-08-15-preview`
6861
```
6962

7063
#### Request body
@@ -154,12 +147,8 @@ To specify the POST request, you can use the Azure PowerShell [Invoke-AzRestMeth
154147

155148
```azurepowershell
156149
Invoke-AzRestMethod
157-
-ResourceGroupName resourceGroupName
158-
-Name "machineName"
159-
-ResourceProviderName "Microsoft.HybridCompute"
160-
-ResourceType "machines"
161-
-ApiVersion 2020-08-15-preview
162-
-Payload '{
150+
-Path "/subscriptions/subscriptionId/resourceGroups/resourcegroupname/providers/Microsoft.HybridCompute/machines/machinename/installPatches?api-version=2020-08-15-preview"
151+
-Payload '{
163152
"maximumDuration": "PT120M",
164153
"rebootSetting": "IfRequired",
165154
"windowsParameters": {

articles/update-center/manage-vms-programmatically.md

Lines changed: 12 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This article tells how to use update management center (preview) in
44
ms.service: update-management-center
55
author: SnehaSudhirG
66
ms.author: sudhirsneha
7-
ms.date: 04/21/2022
7+
ms.date: 03/31/2023
88
ms.topic: conceptual
99
---
1010

@@ -26,26 +26,19 @@ POST on `subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers
2626

2727
# [Azure CLI](#tab/cli)
2828

29-
To specify the POST request, you can use the Azure CLI [az rest](/cli/azure/reference-index#az_rest) command.
29+
To specify the POST request, you can use the Azure CLI [az vm assess-patches](https://learn.microsoft.com/cli/azure/vm?view=azure-cli-latest#az-vm-assess-patches) command.
3030

3131
```azurecli
32-
az rest --method post --url https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Compute/virtualMachines/virtualMachineName/assessPatches?api-version=2020-12-01
32+
az vm assess-patches -g MyResourceGroup -n MyVm
3333
```
3434

35+
3536
# [Azure PowerShell](#tab/powershell)
3637

37-
To specify the POST request, you can use the Azure PowerShell [Invoke-AzRestMethod](/powershell/module/az.accounts/invoke-azrestmethod) cmdlet.
38+
To specify the POST request, you can use the Azure PowerShell [Invoke-AzVMPatchAssessment](https://learn.microsoft.com/powershell/module/az.compute/invoke-azvmpatchassessment?view=azps-9.5.0) cmdlet.
3839

3940
```azurepowershell
40-
Invoke-AzRestMethod
41-
-ResourceGroupName resourceGroupName
42-
-Name "virtualMachineName"
43-
-ResourceProviderName "Microsoft.Compute"
44-
-ResourceType "virtualMachines"
45-
-ApiVersion xx
46-
-Payload '{
47-
}'
48-
-Method POST
41+
Invoke-AzVMPatchAssessment -ResourceGroupName "myRG" -VMName "myVM"
4942
```
5043

5144
---
@@ -107,69 +100,35 @@ POST on 'subscriptions/{subscriptionId}/resourceGroups/acmedemo/providers/Micros
107100

108101
# [Azure CLI](#tab/azurecli)
109102

110-
To specify the POST request, you can use the Azure CLI [az rest](/cli/azure/reference-index#az_rest) command.
103+
To specify the POST request, you can use the Azure CLI [az vm install-patches](https://learn.microsoft.com/cli/azure/vm?view=azure-cli-latest#az-vm-install-patches) command.
111104

112105
```azurecli
113-
az rest --method post --url https://management.azure.com/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Compute/virtualMachines/virtualMachineName/installPatches?api-version=2020-12-01 @body.json
106+
az vm install-patches -g MyResourceGroup -n MyVm --maximum-duration PT4H --reboot-setting IfRequired --classifications-to-include-linux Critical
114107
```
115108

116109
The format of the request body for version 2020-12-01 is as follows:
117110

118111
```json
119112
{
120-
"maximumDuration": "PT120M",
121-
"rebootSetting": "IfRequired",
113+
"maximumDuration"
114+
"rebootSetting"
122115
"windowsParameters": {
123116
"classificationsToInclude": [
124-
"Security",
125-
"UpdateRollup",
126-
"FeaturePack",
127-
"ServicePack"
128117
],
129118
"kbNumbersToInclude": [
130-
"11111111111",
131-
"22222222222222"
132119
],
133120
"kbNumbersToExclude": [
134-
"333333333333",
135-
"55555555555"
136121
]
137122
}
138123
}
139124
```
140125

141126
# [Azure PowerShell](#tab/azurepowershell)
142127

143-
To specify the POST request, you can use the Azure PowerShell [Invoke-AzRestMethod](/powershell/module/az.accounts/invoke-azrestmethod) cmdlet.
128+
To specify the POST request, you can use the Azure PowerShell [Invoke-AzVMInstallPatch](/powershell/module/az.accounts/invoke-azrestmethod) cmdlet.
144129

145130
```azurepowershell
146-
Invoke-AzRestMethod
147-
-ResourceGroupName resourceGroupName
148-
-Name "machineName"
149-
-ResourceProviderName "Microsoft.Compute"
150-
-ResourceType "virtualMachines"
151-
-ApiVersion 2020-12-01-preview
152-
-Payload '{
153-
"maximumDuration": "PT120M",
154-
"rebootSetting": "IfRequired",
155-
"windowsParameters": {
156-
"classificationsToInclude": [
157-
"Security",
158-
"UpdateRollup",
159-
"FeaturePack",
160-
"ServicePack"
161-
],
162-
"kbNumbersToInclude": [
163-
"11111111111",
164-
"22222222222222"
165-
],
166-
"kbNumbersToExclude": [
167-
"333333333333",
168-
"55555555555"
169-
]
170-
}
171-
}'
172-
-Method POST
131+
Invoke-AzVmInstallPatch -ResourceGroupName 'MyRG' -VmName 'MyVM' -Windows -RebootSetting 'never' -MaximumDuration PT2H -ClassificationToIncludeForWindows Critical
173132
```
174133
---
175134

0 commit comments

Comments
 (0)