Skip to content

Commit 306e23c

Browse files
Merge pull request #90534 from dlepow/authaks
[ACR] Retire and redirect auth-aks article
2 parents e3c8e18 + c1a5339 commit 306e23c

15 files changed

+30
-173
lines changed

.openpublishing.redirection.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
"source_path": "articles/azure-government/documentation-government-get-started-connect-with-vs.md",
1010
"redirect_url": "/azure/azure-government/documentation-government-welcome",
1111
"redirect_document_id": false
12-
},
12+
},
13+
{
14+
"source_path": "articles/container-registry/container-registry-auth-aks.md",
15+
"redirect_url": "/azure/aks/cluster-container-registry-integration",
16+
"redirect_document_id": true
17+
},
1318
{
1419
"source_path": "articles/security/develop/security-code-analysis-install.md",
1520
"redirect_url": "/azure/security/develop/security-code-analysis-onboard",

articles/aks/TOC.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@
215215
href: azure-ad-integration.md
216216
- name: Use Kubernetes RBAC with Azure AD integration
217217
href: azure-ad-rbac.md
218-
- name: Authenticate with ACR
219-
href: ../container-registry/container-registry-auth-aks.md
220218
maintainContext: true
221219
- name: Monitoring and logging
222220
items:

articles/aks/jenkins-continuous-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ In this article, you learned how to use Jenkins as part of a CI/CD solution. AKS
336336

337337
<!-- LINKS - internal -->
338338
[az-acr-list]: /cli/azure/acr#az-acr-list
339-
[acr-authentication]: ../container-registry/container-registry-auth-aks.md#grant-aks-access-to-acr
339+
[acr-authentication]: cluster-container-registry-integration.md
340340
[acr-quickstart]: ../container-registry/container-registry-get-started-azure-cli.md
341341
[aks-credentials]: /cli/azure/aks#az-aks-get-credentials
342342
[aks-quickstart]: kubernetes-walkthrough.md

articles/aks/kubernetes-service-principal.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ The following sections detail common delegations that you may need to make.
9191

9292
### Azure Container Registry
9393

94-
If you use Azure Container Registry (ACR) as your container image store, you need to grant permissions for your AKS cluster to read and pull images. The service principal of the AKS cluster must be delegated the *Reader* role on the registry. For detailed steps, see [Grant AKS access to ACR][aks-to-acr].
94+
If you use Azure Container Registry (ACR) as your container image store, you need to grant permissions to the service principal for your AKS cluster to read and pull images. Currently, the recommended configuration is to use the [az aks create][az-aks-create] or [az aks update][az-aks-update] command to integrate with a registry and assign the appropriate role for the service principal. For detailed steps, see [Authenticate with Azure Container Registry from Azure Kubernetes Service][aks-to-acr].
9595

9696
### Networking
9797

@@ -175,6 +175,6 @@ For information on how to update the credentials, see [Update or rotate the cred
175175
[rbac-custom-role]: ../role-based-access-control/custom-roles.md
176176
[rbac-storage-contributor]: ../role-based-access-control/built-in-roles.md#storage-account-contributor
177177
[az-role-assignment-create]: /cli/azure/role/assignment#az-role-assignment-create
178-
[aks-to-acr]: ../container-registry/container-registry-auth-aks.md?toc=%2fazure%2faks%2ftoc.json#grant-aks-access-to-acr
178+
[aks-to-acr]: cluster-container-registry-integration.md
179179
[update-credentials]: update-credentials.md
180180
[azure-ad-permissions]: ../active-directory/fundamentals/users-default-permissions.md

articles/aks/spark-job.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ Check out Spark documentation for more details.
329329

330330

331331
<!-- LINKS - internal -->
332-
[acr-aks]: https://docs.microsoft.com/azure/container-registry/container-registry-auth-aks
332+
[acr-aks]: cluster-container-registry-integration.md
333333
[acr-create]: https://docs.microsoft.com/azure/container-registry/container-registry-get-started-azure-cli
334334
[aks-quickstart]: https://docs.microsoft.com/azure/aks/
335335
[azure-cli]: https://docs.microsoft.com/cli/azure/?view=azure-cli-latest

articles/aks/tutorial-kubernetes-deploy-application.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ To see the application in action, open a web browser to the external IP address
113113

114114
![Image of Kubernetes cluster on Azure](media/container-service-kubernetes-tutorials/azure-vote.png)
115115

116-
If the application didn't load, it might be due to an authorization problem with your image registry. To view the status of your containers, use the `kubectl get pods` command. If the container images can't be pulled, see [allow access to Container Registry with a Kubernetes secret](https://docs.microsoft.com/azure/container-registry/container-registry-auth-aks#access-with-kubernetes-secret).
116+
If the application didn't load, it might be due to an authorization problem with your image registry. To view the status of your containers, use the `kubectl get pods` command. If the container images can't be pulled, see [Authenticate with Azure Container Registry from Azure Kubernetes Service](cluster-container-registry-integration.md).
117117

118118
## Next steps
119119

articles/aks/tutorial-kubernetes-deploy-cluster.md

Lines changed: 6 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ ms.custom: mvc
1818
Kubernetes provides a distributed platform for containerized applications. With AKS, you can quickly create a production ready Kubernetes cluster. In this tutorial, part three of seven, a Kubernetes cluster is deployed in AKS. You learn how to:
1919

2020
> [!div class="checklist"]
21-
> * Create a service principal for resource interactions
22-
> * Deploy a Kubernetes AKS cluster
21+
> * Deploy a Kubernetes AKS cluster that can authenticate to an Azure container registry
2322
> * Install the Kubernetes CLI (kubectl)
2423
> * Configure kubectl to connect to your AKS cluster
2524
@@ -31,60 +30,19 @@ In previous tutorials, a container image was created and uploaded to an Azure Co
3130

3231
This tutorial requires that you're running the Azure CLI version 2.0.53 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][azure-cli-install].
3332

34-
## Create a service principal
35-
36-
To allow an AKS cluster to interact with other Azure resources, an Azure Active Directory service principal is used. This service principal can be automatically created by the Azure CLI or portal, or you can pre-create one and assign additional permissions. In this tutorial, you create a service principal, grant access to the Azure Container Registry (ACR) instance created in the previous tutorial, then create an AKS cluster.
37-
38-
Create a service principal using the [az ad sp create-for-rbac][] command. The `--skip-assignment` parameter limits any additional permissions from being assigned. By default, this service principal is valid for one year.
39-
40-
```azurecli
41-
az ad sp create-for-rbac --skip-assignment
42-
```
43-
44-
The output is similar to the following example:
45-
46-
```
47-
{
48-
"appId": "e7596ae3-6864-4cb8-94fc-20164b1588a9",
49-
"displayName": "azure-cli-2018-06-29-19-14-37",
50-
"name": "http://azure-cli-2018-06-29-19-14-37",
51-
"password": "52c95f25-bd1e-4314-bd31-d8112b293521",
52-
"tenant": "72f988bf-86f1-41af-91ab-2d7cd011db48"
53-
}
54-
```
55-
56-
Make a note of the *appId* and *password*. These values are used in the following steps.
57-
58-
## Configure ACR authentication
59-
60-
To access images stored in ACR, you must grant the AKS service principal the correct rights to pull images from ACR.
61-
62-
First, get the ACR resource ID using [az acr show][]. Update the `<acrName>` registry name to that of your ACR instance and the resource group where the ACR instance is located.
63-
64-
```azurecli
65-
az acr show --resource-group myResourceGroup --name <acrName> --query "id" --output tsv
66-
```
67-
68-
To grant the correct access for the AKS cluster to pull images stored in ACR, assign the `AcrPull` role using the [az role assignment create][] command. Replace `<appId`> and `<acrId>` with the values gathered in the previous two steps.
69-
70-
```azurecli
71-
az role assignment create --assignee <appId> --scope <acrId> --role acrpull
72-
```
73-
7433
## Create a Kubernetes cluster
7534

7635
AKS clusters can use Kubernetes role-based access controls (RBAC). These controls let you define access to resources based on roles assigned to users. Permissions are combined if a user is assigned multiple roles, and permissions can be scoped to either a single namespace or across the whole cluster. By default, the Azure CLI automatically enables RBAC when you create an AKS cluster.
7736

78-
Create an AKS cluster using [az aks create][]. The following example creates a cluster named *myAKSCluster* in the resource group named *myResourceGroup*. This resource group was created in the [previous tutorial][aks-tutorial-prepare-acr]. Provide your own `<appId>` and `<password>` from the previous step where the service principal was created.
37+
Create an AKS cluster using [az aks create][]. The following example creates a cluster named *myAKSCluster* in the resource group named *myResourceGroup*. This resource group was created in the [previous tutorial][aks-tutorial-prepare-acr]. To allow an AKS cluster to interact with other Azure resources, an Azure Active Directory service principal is automatically created, since you did not specify one. Here, this service principal is [granted the right to pull images][container-registry-integration] from the Azure Container Registry (ACR) instance you created in the previous tutorial.
7938

8039
```azurecli
8140
az aks create \
8241
--resource-group myResourceGroup \
8342
--name myAKSCluster \
8443
--node-count 2 \
85-
--service-principal <appId> \
86-
--client-secret <password> \
87-
--generate-ssh-keys
44+
--generate-ssh-keys \
45+
--attach-acr <acrName>
8846
```
8947

9048
After a few minutes, the deployment completes, and returns JSON-formatted information about the AKS deployment.
@@ -124,8 +82,7 @@ aks-nodepool1-12345678-0 Ready agent 32m v1.13.10
12482
In this tutorial, a Kubernetes cluster was deployed in AKS, and you configured `kubectl` to connect to it. You learned how to:
12583

12684
> [!div class="checklist"]
127-
> * Create a service principal for resource interactions
128-
> * Deploy a Kubernetes AKS cluster
85+
> * Deploy a Kubernetes AKS cluster that can authenticate to an Azure container registry
12986
> * Install the Kubernetes CLI (kubectl)
13087
> * Configure kubectl to connect to your AKS cluster
13188
@@ -149,3 +106,4 @@ Advance to the next tutorial to learn how to deploy an application to the cluste
149106
[az aks install-cli]: /cli/azure/aks#az-aks-install-cli
150107
[az aks get-credentials]: /cli/azure/aks#az-aks-get-credentials
151108
[azure-cli-install]: /cli/azure/install-azure-cli
109+
[container-registry-integration]: ./cluster-container-registry-integration.md

articles/aks/virtual-nodes-cli.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Virtual Nodes functionality is heavily dependent on ACI's feature set. The follo
6363
* Init containers
6464
* [Host aliases](https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/)
6565
* [Arguments](../container-instances/container-instances-exec.md#restrictions) for exec in ACI
66-
* [Daemonsets](concepts-clusters-workloads.md#statefulsets-and-daemonsets) will not deploy pods to the virtual node
66+
* [DaemonSets](concepts-clusters-workloads.md#statefulsets-and-daemonsets) will not deploy pods to the virtual node
6767
* [Windows Server nodes (currently in preview in AKS)](windows-container-cli.md) are not supported alongside virtual nodes. You can use virtual nodes to schedule Windows Server containers without the need for Windows Server nodes in an AKS cluster.
6868

6969
## Launch Azure Cloud Shell
@@ -359,6 +359,7 @@ Virtual nodes are often one component of a scaling solution in AKS. For more inf
359359
[aks-github]: https://github.com/azure/aks/issues
360360
[virtual-node-autoscale]: https://github.com/Azure-Samples/virtual-node-autoscale
361361
[virtual-kubelet-repo]: https://github.com/virtual-kubelet/virtual-kubelet
362+
[acr-aks-secrets]: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
362363

363364
<!-- LINKS - internal -->
364365
[azure-cli-install]: /cli/azure/install-azure-cli
@@ -379,4 +380,3 @@ Virtual nodes are often one component of a scaling solution in AKS. For more inf
379380
[aks-basic-ingress]: ingress-basic.md
380381
[az-provider-list]: /cli/azure/provider#az-provider-list
381382
[az-provider-register]: /cli/azure/provider#az-provider-register
382-
[acr-aks-secrets]: ../container-registry/container-registry-auth-aks.md#access-with-kubernetes-secret

articles/aks/virtual-nodes-portal.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Virtual Nodes functionality is heavily dependent on ACI's feature set. The follo
6363
* Init containers
6464
* [Host aliases](https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/)
6565
* [Arguments](../container-instances/container-instances-exec.md#restrictions) for exec in ACI
66-
* [Daemonsets](concepts-clusters-workloads.md#statefulsets-and-daemonsets) will not deploy pods to the virtual node
66+
* [DaemonSets](concepts-clusters-workloads.md#statefulsets-and-daemonsets) will not deploy pods to the virtual node
6767
* [Windows Server nodes (currently in preview in AKS)](windows-container-cli.md) are not supported alongside virtual nodes. You can use virtual nodes to schedule Windows Server containers without the need for Windows Server nodes in an AKS cluster.
6868

6969
## Sign in to Azure
@@ -233,12 +233,12 @@ Virtual nodes are one component of a scaling solution in AKS. For more informati
233233
[aks-github]: https://github.com/azure/aks/issues]
234234
[virtual-node-autoscale]: https://github.com/Azure-Samples/virtual-node-autoscale
235235
[virtual-kubelet-repo]: https://github.com/virtual-kubelet/virtual-kubelet
236+
[acr-aks-secrets]: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
236237

237238
<!-- LINKS - internal -->
238239
[aks-network]: ./networking-overview.md
239240
[az-aks-get-credentials]: /cli/azure/aks?view=azure-cli-latest#az-aks-get-credentials
240241
[aks-hpa]: tutorial-kubernetes-scale.md
241242
[aks-cluster-autoscaler]: cluster-autoscaler.md
242243
[aks-basic-ingress]: ingress-basic.md
243-
[acr-aks-secrets]: ../container-registry/container-registry-auth-aks.md#access-with-kubernetes-secret
244244
[az-provider-list]: /cli/azure/provider#az-provider-list

articles/container-registry/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
- name: Authenticate from Azure Container Instances
9999
href: container-registry-auth-aci.md
100100
- name: Authenticate from Azure Kubernetes Service (AKS)
101-
href: container-registry-auth-aks.md
101+
href: ../aks/cluster-container-registry-integration.md
102102
- name: Roles and permissions
103103
href: container-registry-roles.md
104104
- name: Content trust

0 commit comments

Comments
 (0)