Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions articles/bastion/bastion-connect-to-aks-private-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <subscription ID>
```

1. Retrieve credentials to your AKS private cluster:

```pwsh
```azurecli
az aks get-credentials --admin --name <AKSClusterName> --resource-group <ResourceGroupName>
```

1. Open the tunnel to your target AKS Cluster with either of the following commands:

```pwsh
```azurecli
az aks bastion --name <aksClusterName> --resource-group <aksClusterResourceGroup> --admin --bastion <bastionResourceId>
```

Or:

```pwsh
```azurecli
az network bastion tunnel --name <BastionName> --resource-group <ResourceGroupName> --target-resource-id <AKSClusterID> --resource-port 443 --port <LocalMachinePort>
```

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:<LocalMachinePort>
```bash
kubectl get pods
```

> [!NOTE]
> For aks-preview versions 19.0.0b15 and below, you have to specify the `--server=https://localhost:<LocalMachinePort>` on all `kubectl` commands.
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note should clarify what behavior to expect with version 19.0.0b16 and above, not just what's required for older versions. Consider rephrasing to: 'For aks-preview versions 19.0.0b15 and below, you must specify the --server=https://localhost:<LocalMachinePort> option on all kubectl commands. Version 19.0.0b16 and above automatically configures the kubeconfig to point to the correct server.'

Suggested change
> For aks-preview versions 19.0.0b15 and below, you have to specify the `--server=https://localhost:<LocalMachinePort>` on all `kubectl` commands.
> For aks-preview versions 19.0.0b15 and below, you must specify the `--server=https://localhost:<LocalMachinePort>` option on all `kubectl` commands. Version 19.0.0b16 and above automatically configures the kubeconfig to point to the correct server.

Copilot uses AI. Check for mistakes.
> 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.