<p>I noticed that one of AKS services is in the failed state. When I went to diagnostics, I found out that current version is not supported anymore. So I tried to follow instructions stated here: <a href="https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/aks/upgrade-cluster</a></p>
<p>I ran first the command:</p>
<pre><code>az aks get-upgrades --resource-group myResourceGroup --name myAKSCluster --output table
</code></pre>
<p>and then:</p>
<pre><code>az aks upgrade --resource-group myResourceGroup --name myAKSCluster --kubernetes-version new_version
</code></pre>
<p>and that would produce an error:</p>
<blockquote>
<p>Operation failed with status: 'Conflict'. Details: Upgrades are
disallowed while cluster is in a failed state. For resolution steps
visit <a href="https://aka.ms/aks-cluster-failed" rel="nofollow noreferrer">https://aka.ms/aks-cluster-failed</a> to troubleshoot why the
cluster state may have failed and steps to fix cluster state.</p>
</blockquote>
<p>So, state was failed due to old version, and version could not be updated due to failed state...
I checked this <a href="https://stackoverflow.com/questions/54631309/this-container-service-is-in-a-failed-state">This container service is in a failed state</a> but that was not our problem, we had plenty of resources to go around (which we checked with <code>az aks show --resource-group myResourceGroup  --name myAKSCluster --query agentPoolProfiles</code>)</p>
<p>Deleting and recreating AKS is not an option.</p>

<p>So after hours of trying different solutions and failing, I found fix for this among the answers here: <a href="https://github.com/Azure/AKS/issues/542" rel="nofollow noreferrer">https://github.com/Azure/AKS/issues/542</a></p>
<p>In order to fix failed state because of outdated version, I had to simply  do the following:</p>
<p>Upgrade aks to version that is already there. So my version was 1.14.8 and I simply ran:</p>
<pre><code>az aks upgrade  --resource-group myResourceGroup  --name myAKSCluster --kubernetes-version 1.14.8
</code></pre>
<p>which fixed the failed state of the cluster!</p>
<p>After this I just ran upgrade to the correct next version (1.18.19 in my case):</p>
<pre><code>az aks upgrade  --resource-group myResourceGroup  --name myAKSCluster --kubernetes-version 1.18.19
</code></pre>
<p>I hope that this will save someone hours of frustrations :)</p>
