From 67faebb9971f96e352d4a90491cf979411d1d261 Mon Sep 17 00:00:00 2001 From: bennerv <10840174+bennerv@users.noreply.github.com> Date: Tue, 11 Nov 2025 18:41:03 -0500 Subject: [PATCH] Update AKS bastion instructions to no longer require --server option on newer aks-preview extension versions --- .../bastion-connect-to-aks-private-cluster.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/articles/bastion/bastion-connect-to-aks-private-cluster.md b/articles/bastion/bastion-connect-to-aks-private-cluster.md index 005a8fe18f825..28ac94cc3f4ce 100644 --- a/articles/bastion/bastion-connect-to-aks-private-cluster.md +++ b/articles/bastion/bastion-connect-to-aks-private-cluster.md @@ -51,34 +51,38 @@ To connect to your AKS private cluster: 1. Sign in to your Azure account using `az login` via CLI. If you have more than one subscription, you can view them using `az account list` and select the subscription containing your Bastion resource using: - ```pwsh + ```azurecli az account set --subscription ``` 1. Retrieve credentials to your AKS private cluster: - ```pwsh + ```azurecli az aks get-credentials --admin --name --resource-group ``` 1. Open the tunnel to your target AKS Cluster with either of the following commands: - ```pwsh + ```azurecli az aks bastion --name --resource-group --admin --bastion ``` Or: - ```pwsh + ```azurecli az network bastion tunnel --name --resource-group --target-resource-id --resource-port 443 --port ``` 1. If you're using the az network command, open a new command line to connect to the AKS cluster via the Bastion tunnel. Otherwise, you should be all set to interact with your AKS cluster. - ```pwsh - kubectl get pods --server=https://localhost: + ```bash + kubectl get pods ``` +> [!NOTE] +> For aks-preview versions 19.0.0b17 and below, you must specify the `--server=https://localhost:` option on all `kubectl` commands. Version 19.0.0b17 and above automatically configures the kubeconfig to point to the correct server.. +> You can check the version of your aks-preview extension by running `az extension show -n aks-preview` + ## Next steps Read the [Bastion FAQ](bastion-faq.md) for more connection information.