When using Azure Availability Sets your VMs are placed into Update domains.
Update domains indicate groups of virtual machines and underlying physical hardware that can be rebooted at the same time.
Can I reboot all VMs of an update domain via Azure Portal or are update domains solely for Azure managed reboots?
Created availability set for multiple virtual machines like below:
Update domains in Azure Availability Sets are primarily used for Azure-managed reboots during planned maintenance events to minimize the impact on the availability of your applications.
Manually trigger a reboot of all VMs within a specific update domain directly from the
Azure Portal is not provided as a built-in feature.
These update domains are designed to ensure that, not all virtual machines in an availability set are rebooted simultaneously during planned maintenance, reducing the potential impact on the availability of your application.
Update domains are managed by the Azure platform to control the sequencing of reboots during maintenance events.
To restart you vm in portal like below:
To restart multiple vm in your resource grp, you can make use of below command:
$resourceGroup = "RGName"
# Get a list of VM names in the specified resource group
$vmList = az vm list --resource-group $resourceGroup --query '[].name' --output tsv
# Restart each VM in the list
foreach ($vmName in $vmList) {
Write-Host "Restarting VM: $vmName"
az vm restart --resource-group $resourceGroup --name $vmName
}