Skip to content

Commit f5d4a22

Browse files
authored
Merge pull request #277661 from MicrosoftDocs/main
Publish to live, Sunday 4 AM PST, 6/9
2 parents 056ebbe + 2fe9065 commit f5d4a22

File tree

440 files changed

+1346
-1290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

440 files changed

+1346
-1290
lines changed

articles/aks/TOC.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,10 @@
405405
items:
406406
- name: Azure kubelogin
407407
href: kubelogin-authentication.md
408-
- name: Create service principal
409-
href: kubernetes-service-principal.md
410408
- name: Use managed identities
411409
href: use-managed-identity.md
410+
- name: Create a service principal
411+
href: kubernetes-service-principal.md
412412
- name: Enable access to AKS clusters using Trusted Access
413413
href: trusted-access-feature.md
414414
- name: Limit access to cluster configuration file

articles/aks/access-control-managed-azure-ad.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,13 @@ When you integrate Microsoft Entra ID with your AKS cluster, you can use [Condit
9595
6. Create the AKS cluster with AKS-managed Microsoft Entra integration using the [`az aks create`][az-aks-create] command with the `--aad-admin-group-objects-ids` and `--aad-tenant-id parameters` and include the values noted in the steps earlier.
9696
9797
```azurecli-interactive
98-
az aks create --resource-group myResourceGroup --name myManagedCluster --enable-aad --aad-admin-group-object-ids <object-id> --aad-tenant-id <tenant-id>
98+
az aks create \
99+
--resource-group myResourceGroup \
100+
--name myManagedCluster \
101+
--enable-aad \
102+
--aad-admin-group-object-ids <object-id> \
103+
--aad-tenant-id <tenant-id> \
104+
--generate-ssh-keys
99105
```
100106
101107
7. In the Azure portal, select **Activity** > **Privileged Access (Preview)** > **Enable Privileged Access**.

articles/aks/app-routing-dns-ssl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Learn about monitoring the Ingress-nginx controller metrics included with the ap
226226
[kubectl-get]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get
227227
228228
<!-- LINKS - internal -->
229-
[summary-msi]: use-managed-identity.md#summary-of-managed-identities
229+
[summary-msi]: use-managed-identity.md#summary-of-managed-identities-used-by-aks
230230
[rbac-owner]: ../role-based-access-control/built-in-roles.md#owner
231231
[rbac-classic]: ../role-based-access-control/rbac-and-directory-admin-roles.md#classic-subscription-administrator-roles
232232
[app-routing-add-on-basic-configuration]: app-routing.md

articles/aks/app-routing-nginx-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ Learn about monitoring the ingress-nginx controller metrics included with the ap
531531
[az-network-public-ip-create]: /cli/azure/network/public-ip#az_network_public_ip_create
532532
[az-network-public-ip-list]: /cli/azure/network/public-ip#az_network_public_ip_list
533533
[az-group-create]: /cli/azure/group#az-group-create
534-
[summary-msi]: use-managed-identity.md#summary-of-managed-identities
534+
[summary-msi]: use-managed-identity.md#summary-of-managed-identities-used-by-aks
535535
[rbac-owner]: ../role-based-access-control/built-in-roles.md#owner
536536
[rbac-classic]: ../role-based-access-control/rbac-and-directory-admin-roles.md#classic-subscription-administrator-roles
537537
[app-routing-add-on-basic-configuration]: app-routing.md

articles/aks/azure-cni-overlay.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,6 @@ The following attributes are provided to support dual-stack clusters:
252252
--generate-ssh-keys
253253
```
254254
255-
---
256-
257255
## Create an example workload
258256
259257
Once the cluster has been created, you can deploy your workloads. This article walks you through an example workload deployment of an NGINX web server.
@@ -383,4 +381,3 @@ To learn how to utilize AKS with your own Container Network Interface (CNI) plug
383381
[az-aks-update]: /cli/azure/aks#az-aks-update
384382
[az-extension-add]: /cli/azure/extension#az-extension-add
385383
[az-extension-update]: /cli/azure/extension#az-extension-update
386-

articles/aks/cluster-container-registry-integration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ The AKS to ACR integration assigns the [**AcrPull** role][acr-pull] to the [Micr
286286
<!-- LINKS - external -->
287287
[byo-kubelet-identity]: use-managed-identity.md#use-a-pre-created-kubelet-managed-identity
288288
[image-pull-secret]: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
289-
[summary-msi]: use-managed-identity.md#summary-of-managed-identities
289+
[summary-msi]: use-managed-identity.md#summary-of-managed-identities-used-by-aks
290290
[acr-pull]: ../role-based-access-control/built-in-roles.md#acrpull
291291
[azure-cli-install]: /cli/azure/install-azure-cli
292292
[azure-powershell-install]: /powershell/azure/install-az-ps

articles/aks/configure-kubenet.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ For more information to help you decide which network model to use, see [Compare
159159
160160
#### Create a managed identity
161161
162-
* Create a managed identity using the [`az identity`][az-identity-create] command. If you have an existing managed identity, find the Principal ID using the `az identity show --ids <identity-resource-id>` command instead.
162+
* Create a managed identity using the [`az identity`][az-identity-create] command. If you have an existing managed identity, find the principal ID using the `az identity show --ids <identity-resource-id>` command instead.
163163
164164
```azurecli-interactive
165165
az identity create --name myIdentity --resource-group myResourceGroup
@@ -239,7 +239,7 @@ Kubenet networking requires organized route table rules to successfully route re
239239
* Using the same route table with multiple AKS clusters isn't supported.
240240
241241
> [!NOTE]
242-
> When you create and use your own VNet and route table with the kubenet network plugin, you need to use a [user-assigned control plane identity][bring-your-own-control-plane-managed-identity]. For a system-assigned control plane identity, you can't retrieve the identity ID before creating a cluster, which causes a delay during role assignment.
242+
> When you create and use your own VNet and route table with the kubenet network plugin, you must configure a [user-assigned managed identity][bring-your-own-control-plane-managed-identity] for the cluster. With a system-assigned managed identity, you can't retrieve the identity ID before creating a cluster, which causes a delay during role assignment.
243243
>
244244
> Both system-assigned and user-assigned managed identities are supported when you create and use your own VNet and route table with the Azure network plugin. We highly recommend using a user-assigned managed identity for BYO scenarios.
245245
@@ -295,4 +295,4 @@ This article showed you how to deploy your AKS cluster into your existing virtua
295295
[custom-route-table]: ../virtual-network/manage-route-table.yml
296296
[network-comparisons]: concepts-network-cni-overview.md
297297
[Create an AKS cluster with user-assigned managed identity]: configure-kubenet.md#create-an-aks-cluster-with-user-assigned-managed-identity
298-
[bring-your-own-control-plane-managed-identity]: ../aks/use-managed-identity.md#bring-your-own-managed-identity
298+
[bring-your-own-control-plane-managed-identity]: ../aks/use-managed-identity.md#enable-a-user-assigned-managed-identity

articles/aks/create-nginx-ingress-private-controller.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ For other configuration information related to SSL encryption other advanced NGI
306306
[app-routing-crds]: https://aka.ms/aks/approuting/nginxingresscontrollercrd
307307

308308
<!-- LINKS - internal -->
309-
[summary-msi]: use-managed-identity.md#summary-of-managed-identities
309+
[summary-msi]: use-managed-identity.md#summary-of-managed-identities-used-by-aks
310310
[rbac-owner]: ../role-based-access-control/built-in-roles.md#owner
311311
[rbac-classic]: ../role-based-access-control/rbac-and-directory-admin-roles.md#classic-subscription-administrator-roles
312312
[app-routing-add-on-basic-configuration]: app-routing.md

articles/aks/kubelogin-authentication.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
---
22
title: Use kubelogin to authenticate in Azure Kubernetes Service
3-
description: Learn how to use the kubelogin plugin for all Microsoft Entra authentication methods in Azure Kubernetes Service (AKS).
3+
description: Learn how to use the kubelogin plugin for all Microsoft Entra authentication methods in Azure Kubernetes Service (AKS).
4+
author: tamram
5+
6+
ms.author: tamram
47
ms.topic: article
58
ms.subservice: aks-security
69
ms.custom:

articles/aks/kubernetes-service-principal.md

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: Use a service principal with Azure Kubernetes Services (AKS)
2+
title: Use a service principal with AKS
33
description: Learn how to create and manage a Microsoft Entra service principal with a cluster in Azure Kubernetes Service (AKS).
44
author: tamram
55

6-
ms.topic: conceptual
6+
ms.topic: article
77
ms.subservice: aks-security
8-
ms.date: 06/27/2023
8+
ms.date: 05/30/2024
99
ms.author: tamram
1010
ms.custom: devx-track-azurepowershell, devx-track-azurecli
1111

@@ -14,16 +14,15 @@ ms.custom: devx-track-azurepowershell, devx-track-azurecli
1414

1515
# Use a service principal with Azure Kubernetes Service (AKS)
1616

17-
An AKS cluster requires either an [Microsoft Entra service principal][aad-service-principal] or a [managed identity][managed-identity-resources-overview] to dynamically create and manage other Azure resources, such as an Azure Load Balancer or Azure Container Registry (ACR).
17+
An AKS cluster requires either a [Microsoft Entra service principal][aad-service-principal] or a [managed identity][managed-identity-resources-overview] to dynamically create and manage other Azure resources, such as an Azure Load Balancer or Azure Container Registry (ACR).
1818

19-
> [!NOTE]
20-
> We recommend using managed identities to authenticate with other resources in Azure, and they're the default authentication method for your AKS cluster. For more information about using a managed identity with your cluster, see [Use a system-assigned managed identity][use-managed-identity].
19+
For optimal security and ease of use, Microsoft recommends using managed identities rather than service principals to authorize access from an AKS cluster to other resources in Azure. A managed identity is a special type of service principal that can be used to obtain Microsoft Entra credentials without the need to manage and secure credentials. For more information about using a managed identity with your cluster, see [Use a managed identity in AKS][use-managed-identity].
2120

22-
This article shows you how to create and use a service principal for your AKS clusters.
21+
This article shows you how to create and use a service principal with your AKS clusters.
2322

2423
## Before you begin
2524

26-
To create a Microsoft Entra service principal, you must have permissions to register an application with your Microsoft Entra tenant and to assign the application to a role in your subscription. If you don't have the necessary permissions, you need to ask your Microsoft Entra ID or subscription administrator to assign the necessary permissions or pre-create a service principal for you to use with your AKS cluster.
25+
To create a Microsoft Entra service principal, you must have permissions to register an application with your Microsoft Entra tenant and to assign the application to a role in your subscription. If you don't have the necessary permissions, you need to ask your Microsoft Entra ID or subscription administrator to assign the necessary permissions or pre-create a service principal for use with your AKS cluster.
2726

2827
If you're using a service principal from a different Microsoft Entra tenant, there are other considerations around the permissions available when you deploy the cluster. You may not have the appropriate permissions to read and write directory information. For more information, see [What are the default user permissions in Microsoft Entra ID?][azure-ad-permissions]
2928

@@ -32,7 +31,9 @@ If you're using a service principal from a different Microsoft Entra tenant, the
3231
* If using Azure CLI, you need Azure CLI version 2.0.59 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][install-azure-cli].
3332
* If using Azure PowerShell, you need Azure PowerShell version 5.0.0 or later. Run `Get-InstalledModule -Name Az` to find the version. If you need to install or upgrade, see [Install the Azure Az PowerShell module][install-the-azure-az-powershell-module].
3433

35-
## Manually create a service principal
34+
## Create a service principal
35+
36+
Create a service principal before you create your cluster.
3637

3738
### [Azure CLI](#tab/azure-cli)
3839

@@ -126,33 +127,45 @@ If you're using a service principal from a different Microsoft Entra tenant, the
126127
127128
## Delegate access to other Azure resources
128129
129-
You can use the service principal for the AKS cluster to access other resources. For example, if you want to deploy your AKS cluster into an existing Azure virtual network subnet or connect to Azure Container Registry (ACR), you need to delegate access to those resources to the service principal. Permission granted to a cluster using a system-assigned managed identity may take up 60 minutes to populate.
130+
You can use the service principal for the AKS cluster to access other resources. For example, if you want to deploy your AKS cluster into an existing Azure virtual network subnet, connect to Azure Container Registry (ACR), or access keys or secrets in a key vault from your cluster, then you need to delegate access to those resources to the service principal. To delegate access, assign an Azure role-based access control (Azure RBAC) role to the service principal.
131+
132+
> [!IMPORTANT]
133+
> Permissions granted to a service principal associated with a cluster may take up 60 minutes to propagate.
130134
131135
### [Azure CLI](#tab/azure-cli)
132136
133-
* Create a role assignment using the [`az role assignment create`][az-role-assignment-create] command. Assign the `appId` to a particular scope, such as a resource group or virtual network resource. The role defines what permissions the service principal has on the resource.
137+
* Create a role assignment using the [`az role assignment create`][az-role-assignment-create] command. Provide the value of the service principal's appID for the `appId` parameter. Specify the scope for the role assignment, such as a resource group or virtual network resource. The role assignment determines what permissions the service principal has on the resource and at what scope.
134138
135-
> [!NOTE]
136-
> The `--scope` for a resource needs to be a full resource ID, such as */subscriptions/\<guid\>/resourceGroups/myResourceGroup* or */subscriptions/\<guid\>/resourceGroups/myResourceGroupVnet/providers/Microsoft.Network/virtualNetworks/myVnet*.
139+
For example, to assign the service principal permissions to access secrets in a key vault, you might use the following command:
137140
138141
```azurecli-interactive
139-
az role assignment create --assignee <appId> --scope <resourceScope> --role Contributor
142+
az role assignment create \
143+
--assignee <appId> \
144+
--scope "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.KeyVault/vaults/<vault-name>" \
145+
--role "Key Vault Secrets User"
140146
```
141147
148+
> [!NOTE]
149+
> The `--scope` for a resource needs to be a full resource ID, such as */subscriptions/\<guid\>/resourceGroups/myResourceGroup* or */subscriptions/\<guid\>/resourceGroups/myResourceGroupVnet/providers/Microsoft.Network/virtualNetworks/myVnet*.
150+
142151
### [Azure PowerShell](#tab/azure-powershell)
143152
144-
* Create a role assignment using the [`New-AzRoleAssignment`][new-azroleassignment] command. Assign the `ApplicationId` to a particular scope, such as a resource group or virtual network resource. The role defines what permissions the service principal has on the resource.
153+
* Create a role assignment using the [`New-AzRoleAssignment`][new-azroleassignment] command. Provide the value of the service principal's appID for the `ApplicationId` parameter. Specify the scope for the role assignment, such as a resource group or virtual network resource. The role assignment determines what permissions the service principal has on the resource and at what scope.
145154
146-
> [!NOTE]
147-
> The `Scope` for a resource needs to be a full resource ID, such as */subscriptions/\<guid\>/resourceGroups/myResourceGroup* or */subscriptions/\<guid\>/resourceGroups/myResourceGroupVnet/providers/Microsoft.Network/virtualNetworks/myVnet*
155+
For example, to assign the service principal permissions to access secrets in a key vault, you might use the following command:
148156
149157
```azurepowershell-interactive
150-
New-AzRoleAssignment -ApplicationId <ApplicationId> -Scope <resourceScope> -RoleDefinitionName Contributor
158+
New-AzRoleAssignment -ApplicationId <ApplicationId> `
159+
-Scope "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.KeyVault/vaults/<vault-name>" `
160+
-RoleDefinitionName "Key Vault Secrets User"
151161
```
152162
163+
> [!NOTE]
164+
> The `Scope` for a resource needs to be a full resource ID, such as */subscriptions/\<guid\>/resourceGroups/myResourceGroup* or */subscriptions/\<guid\>/resourceGroups/myResourceGroupVnet/providers/Microsoft.Network/virtualNetworks/myVnet*
165+
153166
---
154167
155-
The following sections detail common delegations that you may need to assign.
168+
The following sections detail common delegations that you may need to assign to a service principal.
156169
157170
### Azure Container Registry
158171
@@ -196,7 +209,11 @@ When using AKS and a Microsoft Entra service principal, consider the following:
196209
* To delete the service principal, query for your cluster's *servicePrincipalProfile.clientId* and delete it using the [`az ad sp delete`][az-ad-sp-delete] command. Replace the values for the `-g` parameter for the resource group name and `-n` parameter for the cluster name:
197210
198211
```azurecli
199-
az ad sp delete --id $(az aks show -g myResourceGroup -n myAKSCluster --query servicePrincipalProfile.clientId -o tsv)
212+
az ad sp delete --id $(az aks show \
213+
--resource-group myResourceGroup \
214+
--name myAKSCluster \
215+
--query servicePrincipalProfile.clientId \
216+
--output tsv)
200217
```
201218
202219
### [Azure PowerShell](#tab/azure-powershell)
@@ -222,7 +239,7 @@ When using AKS and a Microsoft Entra service principal, consider the following:
222239
223240
### [Azure CLI](#tab/azure-cli)
224241
225-
Azure CLI caches the service principal credentials for AKS clusters. If these credentials expire, you encounter errors during AKS cluster deployment. If you run the [`az aks create`][az-aks-create] command and receive an error message similar to the following, it may indicate a problem with the cached service principal credentials:
242+
Azure CLI caches the service principal credentials for AKS clusters. If these credentials expire, you can encounter errors during AKS cluster deployment. If you run the [`az aks create`][az-aks-create] command and receive an error message similar to the following, it may indicate a problem with the cached service principal credentials:
226243
227244
```azurecli
228245
Operation failed with status: 'Bad Request'.
@@ -233,7 +250,10 @@ Details: The credentials in ServicePrincipalProfile were invalid. Please see htt
233250
You can check the expiration date of your service principal credentials using the [`az ad app credential list`][az-ad-app-credential-list] command with the `"[].endDateTime"` query.
234251

235252
```azurecli
236-
az ad app credential list --id <app-id> --query "[].endDateTime" -o tsv
253+
az ad app credential list \
254+
--id <app-id> \
255+
--query "[].endDateTime" \
256+
--output tsv
237257
```
238258

239259
The default expiration time for the service principal credentials is one year. If your credentials are older than one year, you can [reset the existing credentials][reset-credentials] or [create a new service principal][new-service-principal].

0 commit comments

Comments
 (0)