<p>I have a kubernetes cluster with node pools and as a part of Chaos Engineering Initiative,I need to restart the VM. Is there any code for the same using azure resource graph?</p>

<p>When the AKS nodes is a scale set. Then you need to find the node resource group, the scale set name, and the instance-id that you want to restart. And then restart the instance. Here are the CLI commands:</p>
<pre><code># get the AKS node resource group name
az aks show -g groupName -n aksName --query nodeResourceGroup

# get the scale set info and all the instance id
az vmss list -g nodeGroupName --query [].name
az vmss list-instances -g nodeGroupName -n vmssName -o table

# restart the instance with the instance Id
az vmss restart -g nodeGroupName -n vmssName --instance-ids n
</code></pre>
<p>If you do it in the Azure portal, the same steps but it's easier to achieve.</p>
