Skip to content

Commit 7c31595

Browse files
Merge pull request #277219 from alt-key/docs-editor/cluster-connect-1717541483
update microsoft entra id used for single user
2 parents 5b97e3d + 2245f91 commit 7c31595

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

articles/azure-arc/kubernetes/cluster-connect.md

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,73 +78,85 @@ Before you begin, review the [conceptual overview of the cluster connect feature
7878

7979
## Set up authentication
8080

81-
On the existing Arc-enabled cluster, create the ClusterRoleBinding with either Microsoft Entra authentication, or a service account token.
81+
On the existing Arc-enabled cluster, create the ClusterRoleBinding with either Microsoft Entra authentication or service account token.
8282

8383
<a name='azure-active-directory-authentication-option'></a>
8484

8585
### Microsoft Entra authentication option
8686

8787
#### [Azure CLI](#tab/azure-cli)
8888

89-
1. Get the `objectId` associated with your Microsoft Entra entity.
89+
1. Get the `objectId` associated with your Microsoft Entra entity. If you are using a single user account, get the user principal name (UPN) associated with your Microsoft Entra entity.
9090

91-
- For a Microsoft Entra user account:
91+
- For a Microsoft Entra group account:
92+
93+
```azurecli
94+
AAD_ENTITY_ID=$(az ad signed-in-user show --query id -o tsv)
95+
```
96+
97+
- For a Microsoft Entra single user account:
9298
9399
```azurecli
94-
AAD_ENTITY_OBJECT_ID=$(az ad signed-in-user show --query id -o tsv)
100+
AAD_ENTITY_ID=$(az ad signed-in-user show --query userPrincipalName -o tsv)
95101
```
96102
97103
- For a Microsoft Entra application:
98104
99105
```azurecli
100-
AAD_ENTITY_OBJECT_ID=$(az ad sp show --id <id> --query id -o tsv)
106+
AAD_ENTITY_ID=$(az ad sp show --id <id> --query id -o tsv)
101107
```
102108
103109
1. Authorize the entity with appropriate permissions.
104110
105111
- If you're using Kubernetes native ClusterRoleBinding or RoleBinding for authorization checks on the cluster, with the `kubeconfig` file pointing to the `apiserver` of your cluster for direct access, you can create one mapped to the Microsoft Entra entity (service principal or user) that needs to access this cluster. For example:
106112
107113
```console
108-
kubectl create clusterrolebinding demo-user-binding --clusterrole cluster-admin --user=$AAD_ENTITY_OBJECT_ID
114+
kubectl create clusterrolebinding demo-user-binding --clusterrole cluster-admin --user=$AAD_ENTITY_ID
109115
```
110116
111117
- If you're using Azure RBAC for authorization checks on the cluster, you can create an applicable [Azure role assignment](azure-rbac.md#built-in-roles) mapped to the Microsoft Entra entity. For example:
112118
113119
```azurecli
114-
az role assignment create --role "Azure Arc Kubernetes Viewer" --assignee $AAD_ENTITY_OBJECT_ID --scope $ARM_ID_CLUSTER
115-
az role assignment create --role "Azure Arc Enabled Kubernetes Cluster User Role" --assignee $AAD_ENTITY_OBJECT_ID --scope $ARM_ID_CLUSTER
120+
az role assignment create --role "Azure Arc Kubernetes Viewer" --assignee $AAD_ENTITY_ID --scope $ARM_ID_CLUSTER
121+
az role assignment create --role "Azure Arc Enabled Kubernetes Cluster User Role" --assignee $AAD_ENTITY_ID --scope $ARM_ID_CLUSTER
116122
```
117123
118124
#### [Azure PowerShell](#tab/azure-powershell)
119125
120-
1. Get the `objectId` associated with your Microsoft Entra entity.
126+
1. Get the `objectId` associated with your Microsoft Entra entity. If you are using a single user account, you will get the user principal name (UPN) associated with your Microsoft Entra entity.
121127
122-
- For a Microsoft Entra user account:
128+
- For a Microsoft Entra group account:
123129
124130
```azurepowershell
125-
$AAD_ENTITY_OBJECT_ID = (az ad signed-in-user show --query id -o tsv)
131+
$AAD_ENTITY_ID = (az ad signed-in-user show --query id -o tsv)
126132
```
127133
134+
- For a Microsoft Entra single user account:
135+
136+
```azurepowershell
137+
$AAD_ENTITY_ID = (az ad signed-in-user show --query userPrincipalName -o tsv)
138+
```
139+
128140
- For a Microsoft Entra application:
129141
130-
```azurepowershell
131-
$AAD_ENTITY_OBJECT_ID = (az ad sp show --id <id> --query objectId -o tsv)
132-
```
142+
```azurepowershell
143+
$AAD_ENTITY_ID = (az ad sp show --id <id> --query objectId -o tsv)
144+
```
133145
134146
1. Authorize the entity with appropriate permissions.
135147
136-
- If you're using Kubernetes native ClusterRoleBinding or RoleBinding for authorization checks on the cluster, with the `kubeconfig` file pointing to the `apiserver` of your cluster for direct access, you can create one mapped to the Microsoft Entra entity (service principal or user) that needs to access this cluster. For example:
148+
- If you're using native Kubernetes ClusterRoleBinding or RoleBinding for authorization checks on the cluster, with the `kubeconfig` file pointing to the `apiserver` of your cluster for direct access, you can create one mapped to the Microsoft Entra entity (service principal or user) that needs to access this cluster. For example:
137149
138150
```console
139-
kubectl create clusterrolebinding demo-user-binding --clusterrole cluster-admin --user=$AAD_ENTITY_OBJECT_ID
151+
kubectl create clusterrolebinding demo-user-binding --clusterrole cluster-admin --user=$AAD_ENTITY_ID
140152
```
141153
142154
- If you're using [Azure RBAC for authorization checks](azure-rbac.md) on the cluster, you can create an applicable [Azure role assignment](azure-rbac.md#built-in-roles) mapped to the Microsoft Entra entity. For example:
143155
144156
```azurepowershell
145157
146-
az role assignment create --role "Azure Arc Kubernetes Viewer" --assignee $AAD_ENTITY_OBJECT_ID --scope $ARM_ID_CLUSTER
147-
az role assignment create --role "Azure Arc Enabled Kubernetes Cluster User Role" --assignee $AAD_ENTITY_OBJECT_ID --scope $ARM_ID_CLUSTER
158+
az role assignment create --role "Azure Arc Kubernetes Viewer" --assignee $AAD_ENTITY_ID --scope $ARM_ID_CLUSTER
159+
az role assignment create --role "Azure Arc Enabled Kubernetes Cluster User Role" --assignee $AAD_ENTITY_ID --scope $ARM_ID_CLUSTER
148160
```
149161
150162
---

0 commit comments

Comments
 (0)