Skip to content

Commit 0e1627e

Browse files
Address PR comments and feedback.
1 parent 2802240 commit 0e1627e

File tree

3 files changed

+63
-75
lines changed

3 files changed

+63
-75
lines changed

articles/aks/includes/azd/azd-login-ts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.date: 02/21/2024
55
---
66

77
> [!IMPORTANT]
8-
> Certain Azure security policies cause conflicts when used to sign in with `azd login`. As a workaround, you can perform a curl request to the localhost url you were redirected to after you logged in.
8+
> Certain Azure security policies cause conflicts when used to sign in with `azd auth login`. As a workaround, you can perform a curl request to the localhost url you were redirected to after you logged in.
99
1010
The workaround requires the Azure CLI for authentication. If you don't have it or aren't using GitHub Codespaces, install the [Azure CLI][install-azure-cli].
1111

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

Lines changed: 50 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -50,76 +50,6 @@ This tutorial requires Azure Developer CLI version 1.5.1 or later. Check your ve
5050

5151
---
5252

53-
## Create an AKS cluster
54-
55-
AKS clusters can use [Kubernetes role-based access control (Kubernetes RBAC)][k8s-rbac], which allows you to define access to resources based on roles assigned to users. Permissions are combined when users are assigned multiple roles. Permissions can be scoped to either a single namespace or across the whole cluster. For more information, see [Control access to cluster resources using Kubernetes RBAC and Microsoft Entra ID in AKS][aks-k8s-rbac].
56-
57-
For information about AKS resource limits and region availability, see [Quotas, virtual machine size restrictions, and region availability in AKS][quotas-skus-regions].
58-
59-
> [!NOTE]
60-
> To ensure your cluster operates reliably, you should run at least two nodes.
61-
62-
### [Azure CLI](#tab/azure-cli)
63-
64-
To allow an AKS cluster to interact with other Azure resources, the Azure platform automatically creates a cluster identity. In this example, the cluster identity is [granted the right to pull images][container-registry-integration] from the ACR instance you created in the previous tutorial. To execute the command successfully, you need to have an **Owner** or **Azure account administrator** role in your Azure subscription.
65-
66-
* Create an AKS cluster using the [`az aks create`][az aks create] command. 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] in the *eastus* region.
67-
68-
```azurecli-interactive
69-
az aks create \
70-
--resource-group myResourceGroup \
71-
--name myAKSCluster \
72-
--node-count 2 \
73-
--generate-ssh-keys \
74-
--attach-acr <acrName>
75-
```
76-
77-
> [!NOTE]
78-
> If you already generated SSH keys, you may encounter an error similar to `linuxProfile.ssh.publicKeys.keyData is invalid`. To proceed, retry the command without the `--generate-ssh-keys` parameter.
79-
80-
To avoid needing an **Owner** or **Azure account administrator** role, you can also manually configure a service principal to pull images from ACR. For more information, see [ACR authentication with service principals](../container-registry/container-registry-auth-service-principal.md) or [Authenticate from Kubernetes with a pull secret](../container-registry/container-registry-auth-kubernetes.md). Alternatively, you can use a [managed identity](use-managed-identity.md) instead of a service principal for easier management.
81-
82-
### [Azure PowerShell](#tab/azure-powershell)
83-
84-
To allow an AKS cluster to interact with other Azure resources, the Azure platform automatically creates a cluster identity. In this example, the cluster identity is [granted the right to pull images][container-registry-integration] from the ACR instance you created in the previous tutorial. To execute the command successfully, you need to have an **Owner** or **Azure account administrator** role in your Azure subscription.
85-
86-
* Create an AKS cluster using the [`New-AzAksCluster`][new-azakscluster] cmdlet. 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] in the *eastus* region.
87-
88-
```azurepowershell-interactive
89-
New-AzAksCluster -ResourceGroupName myResourceGroup -Name myAKSCluster -NodeCount 2 -GenerateSshKey -AcrNameToAttach <acrName>
90-
```
91-
92-
> [!NOTE]
93-
> If you already generated SSH keys, you may encounter an error similar to `linuxProfile.ssh.publicKeys.keyData is invalid`. To proceed, retry the command without the `-GenerateSshKey` parameter.
94-
95-
To avoid needing an **Owner** or **Azure account administrator** role, you can also manually configure a service principal to pull images from ACR. For more information, see [ACR authentication with service principals](../container-registry/container-registry-auth-service-principal.md) or [Authenticate from Kubernetes with a pull secret](../container-registry/container-registry-auth-kubernetes.md). Alternatively, you can use a [managed identity](use-managed-identity.md) instead of a service principal for easier management.
96-
97-
### [Azure Developer CLI](#tab/azure-azd)
98-
99-
Inside your Azure Developer Template from tutorial 1, run these azd hooks. Each hook contains a script to ready the resources in the template and create your cluster.
100-
101-
1. Register your services with `azd preprovision`.
102-
103-
```azurecli
104-
azd preprovision
105-
```
106-
107-
2. AZD automatically creates the Service Principals and roles based on the `/infra` folder so you don't need to manually generate SSH keys or set up a resource group. Create an AKS cluster using `azd provision`.
108-
109-
```azurecli
110-
azd provision
111-
```
112-
113-
3. AZD can automatically run postprovision after the script ends to build and import new container images. If it doesn't happen, manually run it with `azd postprovision`.
114-
115-
```azurecli
116-
azd provision
117-
```
118-
119-
---
120-
121-
After a few minutes, the cluster deployment completes and returns JSON-formatted information about the AKS deployment.
122-
12353
## Install the Kubernetes CLI
12454

12555
You use the Kubernetes CLI, [`kubectl`][kubectl], to connect to your Kubernetes cluster. If you use the Azure Cloud Shell, `kubectl` is already installed. If you're running the commands locally, you can use the Azure CLI or Azure PowerShell to install `kubectl`.
@@ -228,6 +158,56 @@ Sign in to your Azure Account through AZD configures your credentials.
228158
229159
---
230160
161+
## Create an AKS cluster
162+
163+
AKS clusters can use [Kubernetes role-based access control (Kubernetes RBAC)][k8s-rbac], which allows you to define access to resources based on roles assigned to users. Permissions are combined when users are assigned multiple roles. Permissions can be scoped to either a single namespace or across the whole cluster. For more information, see [Control access to cluster resources using Kubernetes RBAC and Microsoft Entra ID in AKS][aks-k8s-rbac].
164+
165+
For information about AKS resource limits and region availability, see [Quotas, virtual machine size restrictions, and region availability in AKS][quotas-skus-regions].
166+
167+
> [!NOTE]
168+
> To ensure your cluster operates reliably, you should run at least two nodes.
169+
170+
### [Azure CLI](#tab/azure-cli)
171+
172+
To allow an AKS cluster to interact with other Azure resources, the Azure platform automatically creates a cluster identity. In this example, the cluster identity is [granted the right to pull images][container-registry-integration] from the ACR instance you created in the previous tutorial. To execute the command successfully, you need to have an **Owner** or **Azure account administrator** role in your Azure subscription.
173+
174+
* Create an AKS cluster using the [`az aks create`][az aks create] command. 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] in the *eastus* region.
175+
176+
```azurecli-interactive
177+
az aks create \
178+
--resource-group myResourceGroup \
179+
--name myAKSCluster \
180+
--node-count 2 \
181+
--generate-ssh-keys \
182+
--attach-acr <acrName>
183+
```
184+
185+
> [!NOTE]
186+
> If you already generated SSH keys, you may encounter an error similar to `linuxProfile.ssh.publicKeys.keyData is invalid`. To proceed, retry the command without the `--generate-ssh-keys` parameter.
187+
188+
To avoid needing an **Owner** or **Azure account administrator** role, you can also manually configure a service principal to pull images from ACR. For more information, see [ACR authentication with service principals](../container-registry/container-registry-auth-service-principal.md) or [Authenticate from Kubernetes with a pull secret](../container-registry/container-registry-auth-kubernetes.md). Alternatively, you can use a [managed identity](use-managed-identity.md) instead of a service principal for easier management.
189+
190+
### [Azure PowerShell](#tab/azure-powershell)
191+
192+
To allow an AKS cluster to interact with other Azure resources, the Azure platform automatically creates a cluster identity. In this example, the cluster identity is [granted the right to pull images][container-registry-integration] from the ACR instance you created in the previous tutorial. To execute the command successfully, you need to have an **Owner** or **Azure account administrator** role in your Azure subscription.
193+
194+
* Create an AKS cluster using the [`New-AzAksCluster`][new-azakscluster] cmdlet. 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] in the *eastus* region.
195+
196+
```azurepowershell-interactive
197+
New-AzAksCluster -ResourceGroupName myResourceGroup -Name myAKSCluster -NodeCount 2 -GenerateSshKey -AcrNameToAttach <acrName>
198+
```
199+
200+
> [!NOTE]
201+
> If you already generated SSH keys, you may encounter an error similar to `linuxProfile.ssh.publicKeys.keyData is invalid`. To proceed, retry the command without the `-GenerateSshKey` parameter.
202+
203+
To avoid needing an **Owner** or **Azure account administrator** role, you can also manually configure a service principal to pull images from ACR. For more information, see [ACR authentication with service principals](../container-registry/container-registry-auth-service-principal.md) or [Authenticate from Kubernetes with a pull secret](../container-registry/container-registry-auth-kubernetes.md). Alternatively, you can use a [managed identity](use-managed-identity.md) instead of a service principal for easier management.
204+
205+
### [Azure Developer CLI](#tab/azure-azd)
206+
207+
AZD packages the deployment of clusters with the application itself using `azd up`. This command is covered in the next tutorial.
208+
209+
---
210+
231211
## Next steps
232212
233213
In this tutorial, you deployed a Kubernetes cluster in AKS and configured `kubectl` to connect to the cluster. You learned how to:

articles/aks/tutorial-kubernetes-prepare-app.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,26 @@ The [sample application][sample-application] used in this tutorial is a basic st
6464

6565
### [Azure Developer CLI](#tab/azure-azd)
6666

67-
1. Use the Azure Developer CLI ([azd][]) to clone the sample application to your development environment.
67+
1. Create an empty directory named `aks-store-demo` to host the azd template files.
6868

6969
```azurecli
70-
azd init --template aks-store-demo
70+
mkdir aks-store-demo
7171
```
7272

73-
2. Change into the cloned directory.
73+
1. Change into the new directory.
7474

7575
```azurecli
7676
cd aks-store-demo
7777
```
7878

79+
1. Run the Azure Developer CLI ([azd][]) init command which clones the sample application into your empty directory.
80+
81+
Here, the `--template` flag is specified to point to the aks-store-demo application.
82+
83+
```azurecli
84+
azd init --template aks-store-demo
85+
```
86+
7987
---
8088

8189
## Review Docker Compose file
@@ -234,7 +242,7 @@ Since you validated the application's functionality, you can stop and remove the
234242

235243
### [Azure Developer CLI](#tab/azure-azd)
236244

237-
When you use AZD, there are no manual container image dependencies. AZD handles the provisioning, deployment, and cleans up of your applications and clusters.
245+
When you use AZD, there are no manual container image dependencies. AZD handles the provisioning, deployment, and cleans up of your applications and clusters with the `azd up` and `azd down` commands, similar to Docker.
238246

239247
---
240248
## Next steps

0 commit comments

Comments
 (0)