atmos azure aks update-kubeconfig
Download the kubeconfig for an AKS cluster and save it to a file, using the Azure Go SDK. No az CLI or kubelogin binary is required.
Usage
atmos azure aks update-kubeconfig [flags]
This command supports two execution modes:
-
Integration mode: Use a named integration from
auth.integrationsto authenticate via the Atmos auth system and generate kubeconfig using the Go SDK.atmos azure aks update-kubeconfig --integration=dev/aks -
Identity mode: Use an Atmos identity directly with explicit cluster parameters.
atmos azure aks update-kubeconfig --cluster-name=<cluster_name> --resource-group=<resource_group> --identity=<identity_name>
Run atmos azure aks update-kubeconfig --help to see all the available options
Examples
# Using a named integration
atmos azure aks update-kubeconfig --integration=dev/aks
# Using an identity with explicit parameters
atmos azure aks update-kubeconfig --cluster-name=dev-cluster --resource-group=dev-rg --identity=azure-dev
# Overriding the subscription and kubeconfig path
atmos azure aks update-kubeconfig --integration=dev/aks --subscription-id=00000000-0000-0000-0000-000000000000 --kubeconfig=~/.kube/config
# Setting a custom context alias
atmos azure aks update-kubeconfig --integration=dev/aks --alias=dev-aks
Arguments
- n/a
- No positional arguments.
Flags
--integration(optional)Name of a configured integration from
auth.integrations(must bekind: azure/aks). When specified, Atmos authenticates the integration's linked identity and uses the Go SDK to describe the cluster and generate kubeconfig.--cluster-name(optional)- The name of the AKS cluster. Required (with
--resource-groupand--identity) when not using--integration. --resource-group(optional)- The Azure resource group containing the cluster. Required (with
--cluster-nameand--identity) when not using--integration. --subscription-id(optional)- Azure subscription ID. Falls back to the authenticated identity's subscription when omitted.
--identity(alias-i)Atmos identity to authenticate with. When used with
--cluster-nameand--resource-group, Atmos authenticates via the auth system and uses the Go SDK directly.--kubeconfig(optional)kubeconfigfilename to append with the configuration. Defaults to the XDG-compliant path (~/.config/atmos/kube/config).--alias(optional)- Alias for the cluster context name. Defaults to the cluster's ARM resource ID.
Configuration
Integration Mode
AKS integrations are configured in atmos.yaml under auth.integrations:
auth:
providers:
azure-device-code:
kind: azure/device-code
spec:
tenant_id: 00000000-0000-0000-0000-000000000000
identities:
azure-dev:
kind: azure/subscription
via:
provider: azure-device-code
principal:
subscription_id: 11111111-1111-1111-1111-111111111111
integrations:
dev/aks:
kind: azure/aks
via:
identity: azure-dev
spec:
cluster:
name: dev-cluster
resource_group: dev-rg
alias: dev-aks
atmos azure aks update-kubeconfig --integration=dev/aks
How It Works
Unlike az aks get-credentials, this command never shells out to az or requires the kubelogin binary. It:
- Calls the Azure Resource Manager
ManagedClusters.GetAPI for the cluster's ARM resource ID. - Calls
ManagedClusters.ListClusterUserCredentials(formatexec) to obtain the cluster's server endpoint, CA certificate, and the AAD server application ID the cluster expects tokens to be scoped to. - Writes a kubeconfig entry whose exec-credential plugin invokes
atmos azure aks tokeninstead ofkubelogin.
Only AAD-integrated clusters are supported — clusters using local Kubernetes accounts (no AAD integration) are rejected with a clear error.
See Also
- Azure AKS Token Command — Generate AKS bearer tokens for kubectl
- Auth Login Command — Authenticate with identities (triggers auto-provisioned integrations)