Retrieve certificate-based admin kubeconfig in AKS Arc

Applies to: Azure Stack HCI, version 23H2

This article describes how to retrieve a certificate-based admin kubeconfig in AKS enabled by Azure Arc.

Get admin certificate-based kubeconfig

An Arc-enabled Kubernetes cluster admin can retrieve the certificate-based admin kubeconfig using the following command. To run the Azure CLI command, you must have the Microsoft.HybridContainerService/provisionedClusterInstances/listAdminKubeconfig/action action on the cluster. This action is pre-configured in the "Contributor," "Owner," or "Azure Kubernetes Service Arc Cluster Admin" roles.

az aksarc get-credentials --name 
                       --resource-group 
                       [--admin] 
                       [--context] 
                       [--file] 
                       [--overwrite-existing]
Parameter Description
--name Name of the Arc-enabled AKS instance.
--resource-group Name of the resource group.
--admin Cluster admin credentials.
--context If specified, overwrite the default context name. The --admin parameter takes precedence over --context.
--file Kubernetes configuration file to update. The default is to add a new admin kubeconfig into the default kubeconfig path, which is ~.kube\config.
--overwrite-existing Overwrites an existing cluster entry with the same name. The default value is False.

For more information, see the documentation for az aksarc.

Next steps

AKS Arc overview