<p>Last night I used PowerShell to deploy a Kubernetes cluster on AKS with something like this:</p>
<pre><code>New-AzureRmAks -ResourceGroupName &quot;my-rg&quot; -Name &quot;my-aks-cluster&quot; -KubernetesVersion &quot;1.16.13&quot; -NodeCount 2 -NodeVmSize &quot;Standard_DS2_V2&quot; -Verbose
</code></pre>
<p>This worked fine. Today, however, I tried this same thing in a different subscription, but keep getting the following error:</p>
<pre><code>VERBOSE: Cluster does not exist.
VERBOSE: Cluster is new.
VERBOSE: Performing the operation &quot;Creating a managed Kubernetes cluster.&quot; on target &quot;my-aks-cluster in my-rg&quot;.
VERBOSE: Preparing for deployment of your managed Kubernetes cluster.
VERBOSE: Using location eastus from the resource group my-rg.
VERBOSE: Using DNS name prefix my-aks-cluster-my-rg-dcdf2a.
VERBOSE: Fetching SSH public key from file C:\Users\myuser\.ssh\id_rsa.pub
New-AzureRmAks : The given key was not present in the dictionary.
At line:1 char:1
+ New-AzureRmAks -ResourceGroupName &quot;my-reg&quot; -Name &quot;my-aks-cluster&quot; -Kube ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [New-AzureRmAks], KeyNotFoundException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.Aks.NewAzureRmAks
</code></pre>
<p>I'm confused because:</p>
<ol>
<li>This same command worked earlier</li>
<li>I have same admin rights to new subscription as to the one previously used</li>
<li>The path to the key is valid</li>
<li>The key, id_rsa.pub, is at the path listed</li>
</ol>
<p>Anyone have an idea what is going on here? Any tips are appreciated.</p>

Zeke MC
<p>I can reproduce this issue with the same user account when only changing to a new subscription in another directory.</p>
<p>To fix it, you can delete all files but leave <code>TokenCache.dat</code> file in the <code>.Azure</code> folder of the path</p>
<pre><code>C:\Users\myuser\.Azure
</code></pre>
<p><a href="https://i.stack.imgur.com/N1RdY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N1RdY.png" alt="enter image description here" /></a></p>
<p>Then re-connect the subscription.</p>
<p><a href="https://i.stack.imgur.com/Ex1E9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ex1E9.png" alt="enter image description here" /></a></p>
<h2>Edit</h2>
<p>In this case, deleting the file <code>acsServicePrincipal</code> under the local <code>.azure</code>  directory is to fix this issue.</p>
