Skip to content

Commit e6734b1

Browse files
authored
Merge pull request #100487 from v-davit/patch-2
Added 'Check update status' section
2 parents a34f14e + 4084552 commit e6734b1

File tree

1 file changed

+38
-3
lines changed

1 file changed

+38
-3
lines changed

articles/virtual-machines/maintenance-control-powershell.md

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ With maintenance control, you can:
3333
## Limitations
3434

3535
- VMs must be on a [dedicated host](./linux/dedicated-hosts.md), or be created using an [isolated VM size](./linux/isolation.md).
36-
- After 35 days, an update will automatically be applied and availability constraints will not be respected.
36+
- After 35 days, an update will automatically be applied.
3737
- User must have **Resource Owner** access.
3838

3939

@@ -106,7 +106,7 @@ New-AzConfigurationAssignment `
106106
-MaintenanceConfigurationId $config.Id
107107
```
108108

109-
### Dedicate host
109+
### Dedicated host
110110

111111
To apply a configuration to a dedicated host, you also need to include `-ResourceType hosts`, `-ResourceParentName` with the name of the host group, and `-ResourceParentType hostGroups`.
112112

@@ -126,7 +126,9 @@ New-AzConfigurationAssignment `
126126

127127
## Check for pending updates
128128

129-
Use [Get-AzMaintenanceUpdate](https://docs.microsoft.com/powershell/module/az.maintenance/get-azmaintenanceupdate) to see if there are pending updates. Use `-subscription` to specify the Azure subscription of the VM if it is different from the one that you are logged into.
129+
Use [Get-AzMaintenanceUpdate](https://docs.microsoft.com/powershell/module/az.maintenance/get-azmaintenanceupdate) to see if there are pending updates. Use `-subscription` to specify the Azure subscription of the VM if it is different from the one that you are logged into.
130+
131+
If there are no updates, the command will return an error message: `Resource not found...StatusCode: 404`.
130132

131133
### Isolated VM
132134

@@ -184,6 +186,39 @@ New-AzApplyUpdate `
184186
-ProviderName Microsoft.Compute
185187
```
186188

189+
## Check update status
190+
Use [Get-AzApplyUpdate](https://docs.microsoft.com/powershell/module/az.maintenance/get-azapplyupdate) to check on the status of an update. The commands shown below show the status of the latest update by using `default` for the `-ApplyUpdateName` parameter. You can substitute the name of the update (returned by the [New-AzApplyUpdate](https://docs.microsoft.com/powershell/module/az.maintenance/new-azapplyupdate) command) to get the status of a specific update.
191+
192+
If there are no updates to show, the command will return an error message: `Resource not found...StatusCode: 404`.
193+
194+
### Isolated VM
195+
196+
Check for updates to a specific virtual machine.
197+
198+
```azurepowershell-interactive
199+
Get-AzApplyUpdate `
200+
-ResourceGroupName myResourceGroup `
201+
-ResourceName myVM `
202+
-ResourceType VirtualMachines `
203+
-ProviderName Microsoft.Compute `
204+
-ApplyUpdateName default
205+
```
206+
207+
### Dedicated host
208+
209+
Check for updates to a dedicated host.
210+
211+
```azurepowershell-interactive
212+
Get-AzApplyUpdate `
213+
-ResourceGroupName myResourceGroup `
214+
-ResourceName myHost `
215+
-ResourceType hosts `
216+
-ResourceParentName myHostGroup `
217+
-ResourceParentType hostGroups `
218+
-ProviderName Microsoft.Compute `
219+
-ApplyUpdateName default
220+
```
221+
187222
## Remove a maintenance configuration
188223

189224
Use [Remove-AzMaintenanceConfiguration](https://docs.microsoft.com/powershell/module/az.maintenance/remove-azmaintenanceconfiguration) to delete a maintenance configuration.

0 commit comments

Comments
 (0)