You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example shows how to use the [kubelogin](https://github.com/Azure/kubelogin) to authenticate using [managed identities](https://learn.microsoft.com/en-us/entra/identity/managed-identities-azure-resources/overview) with Azure Kubernetes Service (AKS) using the C# SDK.
4
+
5
+
6
+
## Prerequisites
7
+
8
+
- turn on AAD support for AKS, see [here](https://docs.microsoft.com/en-us/azure/aks/managed-aad)
9
+
- create a managed identity for the AKS cluster
10
+
- assign the managed identity the `Azure Kubernetes Service RBAC Cluster Admin` (or other RBAC permission) on the AKS cluster
11
+
- assign the managed identity to the VM, see [here](https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm)
12
+
- install the [kubelogin](https://github.com/Azure/kubelogin) to your machine
13
+
14
+
## Running the code
15
+
16
+
*You must the the code on VM with MSI*
17
+
18
+
- Replace `server` with the address of your AKS cluster
19
+
- Replace `clientid` with the client id of the managed identity
20
+
- Replace `kubelogin` with the path to the kubelogin executable
0 commit comments