<p>I have created a managed Kubernetes cluster in Azure, but it's only for learning purposes and so I only want to pay for the compute whilst I'm actually using it.</p>

<p>Is there a easy way to gracefully shut down and start up the VMs, availablity sets and load balancers?</p>

<p>You could use the <a href="https://learn.microsoft.com/en-us/cli/azure/?view=azure-cli-latest" rel="nofollow noreferrer">Azure CLI</a> to <a href="https://learn.microsoft.com/en-gb/azure/aks/start-stop-cluster" rel="nofollow noreferrer">stop the the entire cluster</a>:</p>
<pre><code>az aks stop --name myAksCluster --resource-group myResourceGroup
</code></pre>
<p>And start it again with</p>
<pre><code>az aks start --name myAksCluster --resource-group myResourceGroup
</code></pre>
<hr />
<p>Before this feature, it was possible to stop the virtual machines via Powershell:</p>
<pre><code>az vm deallocate --ids $(az vm list -g MC_my_resourcegroup_westeurope --query &quot;[].id&quot; -o tsv)
</code></pre>
<p>Replace <code>MC_my_resourcegroup_westeurope</code> with the name of your resource group that contains the VM(s).</p>
<p>When you want to start the VM(s) again, run:</p>
<pre><code>az vm start --ids $(az vm list -g MC_my_resourcegroup_westeurope --query &quot;[].id&quot; -o tsv)
</code></pre>
