<p>I'm currently having some issues to sign in to a private AKS Cluster with the following commands:</p>
<pre><code>az account set --subscription [subscription_id]
</code></pre>
<pre><code>az aks get-credentials --resource-group [resource-group] --name [AKS_cluster_name]
</code></pre>
<p>After I typed those two commands it ask me to authenticate through the web with a code that is generated by AZ CLI, and after that, I have the following issue on the terminal:</p>
<pre><code>To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code RTEEREDTE to authenticate.
Unable to connect to the server: dial tcp: lookup aksdusw2aks01-0581cf8f.hcp.westus2.azmk8s.io: i/o timeout
</code></pre>
<p>What could be the potential issue? How can I successfully login to a private AKS Cluster?</p>
<p>Notes:</p>
<p>I have some other clusters and I'm able to login to them through the terminal without having any type or kind of errors.</p>

Hvaandres
<p>You cant use kubectl to access the API Server of a private  AKS cluster, thats the design by making it private (no public access). You will need to use <a href="https://learn.microsoft.com/en-us/azure/aks/command-invoke" rel="noreferrer">az aks command invoke</a> to invoke commands through the Azure API:</p>
<pre><code>az aks command invoke -n &lt;CLUSTER_NAME&gt; -g &lt;CLUSTER_RG&gt; -c &quot;kubectl get pods -A&quot;
</code></pre>
