Skip to content

Commit b3a1300

Browse files
committed
PR edits based on feedback
1 parent cd40bd2 commit b3a1300

File tree

5 files changed

+91
-127
lines changed

5 files changed

+91
-127
lines changed

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

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,33 @@
11
---
22
ms.service: azure-kubernetes-service
33
ms.topic: include
4-
ms.date: 02/21/2024
4+
ms.date: 03/15/2024
55
---
66

77
### azd auth workaround
88

9-
> [!IMPORTANT]
10-
> If you are using an out-of-network virtual machine, or GitHub Codespace, 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.
9+
This workaround requires you to have the [Azure CLI][install-azure-cli] installed.
1110

12-
This workaround requires you to have the [Azure CLI][install-azure-cli] and run `azd auth login` prior.
13-
14-
1. Open a terminal window and log in with the Azure CLI through the browser. Use the `az login` command with the `--scope` parameter set to `https://graph.microsoft.com/.default`. This is required to workaround certain device related policies that may cause the issue.
11+
1. Open a terminal window and log in with the Azure CLI using the [`az login`][az-login] command with the `--scope` parameter set to `https://graph.microsoft.com/.default`.
1512

1613
```azurecli-interactive
1714
az login --scope https://graph.microsoft.com/.default
1815
```
1916
20-
You should be redirected to an authenthication page in a new tab to create a browser access token:
17+
You should be redirected to an authentication page in a new tab to create a browser access token, as shown in the following example:
2118
2219
```output
2320
https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize?clientid=<your_client_id>.
2421
```
2522
26-
1. Copy the localhost URL of the webpage after signing in with `azd auth login`.
27-
28-
```output
29-
http://localhost:<port>/?code=<token>
30-
```
31-
32-
1. In a new terminal window, use the following curl request to log in. Make sure you replace the `<localhost>` placeholder with the localhost URL you copied in the previous step.
23+
2. Copy the localhost URL of the webpage you received after attempting to sign in with `azd auth login`.
24+
3. In a new terminal window, use the following `curl` request to log in. Make sure you replace the `<localhost>` placeholder with the localhost URL you copied in the previous step.
3325
3426
```console
3527
curl <localhost>
3628
```
3729
38-
A successful login outputs an HTML webpage:
30+
A successful login outputs an HTML webpage, as shown in the following example:
3931
4032
```output
4133
<!DOCTYPE html>
@@ -73,14 +65,15 @@ This workaround requires you to have the [Azure CLI][install-azure-cli] and run
7365
</html>
7466
```
7567
76-
1. Close the new terminal and open the old terminal. A JSON list of your subscriptions should appear.
77-
78-
1. Copy and note down the `id` field of the subscription you want to use.
79-
80-
1. Select your subscription using the [az account set](/cli/azure/account#az-account-set) command.
68+
4. Close the current terminal and open the original terminal. You should see a JSON list of your subscriptions.
69+
5. Copy the `id` field of the subscription you want to use.
70+
6. Set your subscription using the [`az account set`][az-account-set] command.
8171
8272
```azurecli-interactive
83-
az account set -n <sub>
73+
az account set --subscription <subscription_id>
8474
```
8575
86-
[install-azure-cli]: /cli/azure/install-azure-cli
76+
<!-- LINKS - internal -->
77+
[install-azure-cli]: /cli/azure/install-azure-cli
78+
[az-login]: /cli/azure/#az-login
79+
[az-account-set]: /cli/azure/account#az-account-set

articles/aks/learn/quick-kubernetes-deploy-azd.md

Lines changed: 51 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
---
2-
title: 'Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using the Azure Developer CLI (`azd`)'
3-
description: Learn how to quickly deploy a Kubernetes cluster and deploy an application in Azure Kubernetes Service (AKS) using `azd`.
2+
title: 'Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using the Azure Developer CLI'
3+
description: Learn how to quickly deploy a Kubernetes cluster and deploy an application in Azure Kubernetes Service (AKS) using the Azure Developer CLI.
4+
ms.author: schaffererin
5+
author: schaffererin
46
ms.topic: quickstart
5-
ms.date: 03/06/2024
7+
ms.date: 03/15/2024
68
ms.custom: H1Hack27Feb2017, mvc, devcenter, seo-javascript-september2019, seo-javascript-october2019, seo-python-october2019, devx-track-azurecli, contperf-fy21q1, mode-api, linux-related-content, devx-track-extended-azdevcli
79
#Customer intent: As a developer or cluster operator, I want to deploy an AKS cluster and deploy an application so I can see how to run applications using the managed Kubernetes service in Azure.
810
---
911

10-
# Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using the Azure Developer CLI (`azd`)
12+
# Quickstart: Deploy an Azure Kubernetes Service (AKS) cluster using the Azure Developer CLI
1113

1214
Azure Kubernetes Service (AKS) is a managed Kubernetes service that lets you quickly deploy and manage clusters. In this quickstart, you learn to:
1315

1416
- Download and install the Azure Developer CLI (`azd`).
1517
- Clone applications from an Azure Developer CLI template (`azd` template).
1618
- Deploy an AKS cluster using the Azure Developer CLI (`azd`).
1719
- Run a sample multi-container application with a group of microservices that simulates a retail app.
18-
- Delete and cleanup containers made from the `azd` template.
20+
- Delete and clean up containers made from the `azd` template.
1921

2022
> [!NOTE]
2123
> To get started with quickly provisioning an AKS cluster, this article includes steps to deploy a cluster with default settings for evaluation purposes only. Before deploying a production-ready cluster, we recommend that you familiarize yourself with our [baseline reference architecture][baseline-reference-architecture] to consider how it aligns with your business requirements.
@@ -29,13 +31,11 @@ This quickstart assumes a basic understanding of Kubernetes concepts. For more i
2931
- For ease of use, run this sample on Bash or PowerShell in the [Azure Cloud Shell](/azure/cloud-shell/overview). For more information, see [Quickstart for Azure Cloud Shell](/azure/cloud-shell/quickstart).
3032

3133
- To use `azd` locally, install version 1.6.1 or later of the [Azure Developer CLI][azd-install].
34+
- If you're using the [Azure Cloud Shell](/azure/cloud-shell/overview), the latest version of `azd` is already installed.
3235

33-
- If you're using the [Azure Cloud Shell](/azure/cloud-shell/overview), the latest version is already installed on there.
36+
## Review application code
3437

35-
36-
## Sample Code
37-
38-
All code used in the quickstart is available at [Azure-Samples/aks-store-demo](https://github.com/Azure-Samples/aks-store-demo).
38+
You can review the application code in the [Azure-Samples/aks-store-demo GitHub repository](https://github.com/Azure-Samples/aks-store-demo).
3939

4040
The quickstart application includes the following Kubernetes deployments and services:
4141

@@ -49,17 +49,15 @@ The quickstart application includes the following Kubernetes deployments and ser
4949
> [!NOTE]
5050
> We don't recommend running stateful containers, such as Rabbit MQ, without persistent storage for production use. These are used here for simplicity, but we recommend using managed services instead, such as Azure CosmosDB or Azure Service Bus.
5151
52-
## Clone the Azure Developer CLI Template
53-
54-
`azd` can clone files directly from a GitHub repository with `azd init`. For this quickstart, clone the sample `azd` template using the `--template` flag along with the owner and name of the repository.
52+
## Clone the Azure Developer CLI template
5553

56-
1. Clone the AKS Store Demo template from the **Azure-Samples** repository by running the `azd init` command and specifying `aks-store-demo`.
54+
1. Clone the AKS store demo template from the **Azure-Samples** repository using the [`azd init`][azd-init] command with the `--template` parameter.
5755

5856
```azdeveloper
5957
azd init --template Azure-Samples/aks-store-demo
6058
```
6159
62-
1. Choose an environment name for your project that uses only alphanumeric characters and hyphens.
60+
2. Enter an environment name for your project that uses only alphanumeric characters and hyphens, such as *aks-azdqs-1*.
6361
6462
```output
6563
Enter a new environment name: aks-azdqs-1
@@ -69,24 +67,25 @@ The quickstart application includes the following Kubernetes deployments and ser
6967
7068
The `azd` template contains all the code needed to create the services, but you need to sign in to your Azure account in order to host the application on AKS.
7169
72-
1. Sign in to your account with azd.
70+
1. Sign in to your account using the [`azd auth login`][az-auth-login] command.
7371
7472
```azdeveloper
7573
azd auth login
7674
```
7775
78-
1. Copy the device code that appears then press enter to sign-in.
76+
2. Copy the device code that appears in the output and press enter to sign in.
7977
8078
```output
8179
Start by copying the next code: XXXXXXXXX
8280
Then press enter and continue to log in from your browser...
8381
```
8482
85-
1. Authenticate with your credentials on your organization's sign in page.
83+
> [!IMPORTANT]
84+
> If you're using an out-of-network virtual machine or GitHub Codespace, certain Azure security policies cause conflicts when used to sign in with `azd auth login`. If you run into an issue here, you can follow the [azd auth workaround](../includes/azd/azd-login-ts.md), which involves using a `curl` request to the localhost URL you were redirected to after running [`azd auth login`][az-auth-login].
8685
87-
1. Confirm that it's you trying to connect from the Azure CLI.
88-
89-
1. Verify the message "Device code authentication completed. Logged in to Azure." appears in your original terminal.
86+
3. Authenticate with your credentials on your organization's sign in page.
87+
4. Confirm that it's you trying to connect from the Azure CLI.
88+
5. Verify the message "Device code authentication completed. Logged in to Azure." appears in your original terminal.
9089
9190
```output
9291
Waiting for you to complete authentication in the browser...
@@ -98,80 +97,55 @@ The `azd` template contains all the code needed to create the services, but you
9897
9998
## Create and deploy resources for your cluster
10099
101-
`azd` runs all the hooks inside of the `azd-hooks` folder to preregister, provision, then deploy these services.
102-
103-
This `azd` template creates a new resource group with an Azure Kubernetes cluster and Azure Keyvault. The keyvault is used to store client secrets. Within the cluster, it runs your app's services in the pets namespace.
100+
`azd` runs all the hooks inside of the [`azd-hooks` folder](https://github.com/Azure-Samples/aks-store-demo/tree/main/azd-hooks) to preregister, provision, and deploy the application services.
104101
105-
- **makeline-service**: Processes orders from the queue and completing them.
106-
- **order-service**: Place orders for products.
107-
- **product-service**: Perform create, read, update, or delete operations on products.
108-
- **store-front**: Web app for customers to view products and place orders.
109-
- **rabbit-mq**: Message queue for an order queue.
102+
The `azd` template for this quickstart creates a new resource group with an AKS cluster and an Azure key vault. The key vault stores client secrets and runs the services in the `pets` namespace
110103
111-
1. Create all your resources with the `azd up` command.
104+
1. Create all the application resources using the [`azd up`][azd-up] command.
112105
113106
```azdeveloper
114107
azd up
115108
```
116109
117-
1. Select an Azure subscription for your billing usage.
110+
2. Select an Azure subscription for your billing usage.
118111
119112
```output
120113
? Select an Azure Subscription to use: [Use arrows to move, type to filter]
121114
> 1. My Azure Subscription (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
122115
```
123116
124-
1. Select a region to deploy your application to.
117+
3. Select a region to deploy your application to.
125118
126119
```output
127120
Select an Azure location to use: [Use arrows to move, type to filter]
128-
40. (South America) Brazil Southeast (brazilsoutheast)
129-
41. (US) Central US (centralus)
130-
42. (US) East US (eastus)
121+
1. (South America) Brazil Southeast (brazilsoutheast)
122+
2. (US) Central US (centralus)
123+
3. (US) East US (eastus)
131124
> 43. (US) East US 2 (eastus2)
132-
44. (US) East US STG (eastusstg)
133-
45. (US) North Central US (northcentralus)
134-
46. (US) South Central US (southcentralus)
125+
4. (US) East US STG (eastusstg)
126+
5. (US) North Central US (northcentralus)
127+
6. (US) South Central US (southcentralus)
135128
```
136129
137-
1. Wait as azd automatically runs the commands for pre-provision and post-provision steps.
130+
`azd` automatically runs the preprovioning and postprovisioning commands to create the resources for your application. This process can take a few minutes to complete. Once complete, you should see an output similar to the following example:
138131
139132
```output
140-
SUCCESS: Your up workflow to provision and deploy to Azure completed in 9 minutes 40 seconds.
133+
SUCCESS: Your workflow to provision and deploy to Azure completed in 9 minutes 40 seconds.
141134
```
142135
143136
## Test the application
144137
145-
When your application is created, a Kubernetes service exposes the application's front end service to the internet. This process can take a few minutes to complete.
138+
When the application runs, a Kubernetes service exposes the application front end to the internet. This process can take a few minutes to complete.
146139
147-
1. Set your namespace as the demo namespace `pets` with the `kubectl set-context` command.
140+
1. Set your namespace as the demo namespace `pets` using the [`kubectl set-context`][kubectl-set-context] command.
148141
149142
```console
150143
kubectl config set-context --current --namespace=pets
151144
```
152145
153-
1. View the status of the deployed pods with the [kubectl get pods][kubectl-get] command.
146+
2. Check the status of the deployed pods using the [`kubectl get pods`][kubectl-get-pods] command. Make sure all pods are `Running` before proceeding.
154147
155-
Display all deployed pods in your namespace:
156-
157-
```console
158-
kubectl get pods
159-
```
160-
161-
Inspect the status in these services are `Running`:
162-
163-
```output
164-
NAME READY STATUS
165-
order-service-8dfcffdd4-9zdj8 1/1 Running
166-
product-service-848898fcc-4988r 1/1 Running
167-
store-front-6774d4856d-2g4rn 1/1 Running
168-
virtual-customer-8485855-ztgdw 1/1 Running
169-
virtual-worker-7db7f799f-lkxnq 1/1 Running
170-
```
171-
172-
1. Search for a public IP address for the front end store-front application.
173-
174-
Monitor progress using the [kubectl get service][kubectl-get] command with the `--watch` argument:
148+
3. Check for a public IP address for the store-front application and monitor progress using the [`kubectl get service`][kubectl-get] command with the `--watch` argument.
175149
176150
```console
177151
kubectl get service store-front --watch
@@ -184,7 +158,7 @@ When your application is created, a Kubernetes service exposes the application's
184158
store-front LoadBalancer 10.0.100.10 <pending> 80:30025/TCP 4h4m
185159
```
186160
187-
1. When the **EXTERNAL-IP** address changes from *pending* to a public IP address, use `CTRL-C` to stop the `kubectl` watch process.
161+
4. Once the **EXTERNAL-IP** address changes from *pending* to an actual public IP address, use `CTRL-C` to stop the `kubectl` watch process.
188162
189163
The following sample output shows a valid public IP address assigned to the service:
190164
@@ -193,46 +167,42 @@ When your application is created, a Kubernetes service exposes the application's
193167
store-front LoadBalancer 10.0.100.10 20.62.159.19 80:30025/TCP 4h5m
194168
```
195169
196-
1. Open a web browser using the external IP address of your service to view the Azure Store app in action.
170+
5. Open a web browser to the external IP address of your service to see the Azure Store app in action.
197171
198172
:::image type="content" source="media/quick-kubernetes-deploy-cli/aks-store-application.png" alt-text="Screenshot of AKS Store sample application." lightbox="media/quick-kubernetes-deploy-cli/aks-store-application.png":::
199173
200-
### Visit the store-front
201-
202-
Once on the store page, you can add new items to your cart and check them out. To verify, visit the Azure Service in your portal to view the records of the transactions for your store app.
203-
204174
## Delete the cluster
205175
206-
Once you're finished with the quickstart, remember to clean up all your resources to avoid Azure charges.
176+
Once you're finished with the quickstart, clean up unnecessary resources to avoid Azure charges.
207177
208-
1. Use `azd down` to delete all your resources used in the quickstart, which includes your resource group, cluster, and related Azure Services.
178+
1. Delete all the resources created in the quickstart using the [`azd down`][az-down] command.
209179
210180
```azdeveloper
211181
azd down
212182
```
213183
214-
Confirm your decision to remove all used resources from your subscription.
184+
2. Confirm your decision to remove all used resources from your subscription by typing `y` and pressing `Enter`.
215185
216186
```output
217187
? Total resources to delete: 14, are you sure you want to continue? (y/N)
218188
```
219-
220-
1. Allow purge to reuse the quickstart variables if applicable.
189+
190+
3. Allow purge to reuse the quickstart variables if applicable by typing `y` and pressing `Enter`.
221191
222192
```output
223193
[Warning]: These resources have soft delete enabled allowing them to be recovered for a period or time after deletion. During this period, their names may not be reused. In the future, you can use the argument --purge to skip this confirmation.
224194
225195
? Would you like to permanently delete these resources instead, allowing their names to be reused? (y/N)
226196
```
227197
228-
1. Close the terminal once the cleanup process is complete.
198+
Once the resources are deleted, you should see an output similar to the following example:
229199
230200
```output
231201
SUCCESS: Your application was removed from Azure in 14 minutes 30 seconds.
232202
```
233203
234204
> [!NOTE]
235-
> This sample application is for demo purposes and doesn't represent all the best practices for Kubernetes applications.
205+
> This sample application is for demo purposes and doesn't represent all the best practices for Kubernetes applications.
236206
> For guidance on creating full solutions with AKS for production, see [AKS solution guidance][aks-solution-guidance].
237207
238208
## Next steps
@@ -248,6 +218,8 @@ To learn more about AKS and walk through a complete code-to-deployment example,
248218
[kubectl]: https://kubernetes.io/docs/reference/kubectl/
249219
[kubectl-apply]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply
250220
[kubectl-get]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get
221+
[kubectl-set-context]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#config-set-context
222+
[kubectl-get-pods]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get-pods
251223
252224
<!-- LINKS - internal -->
253225
[aks-tutorial]: ../tutorial-kubernetes-prepare-app.md
@@ -259,6 +231,9 @@ To learn more about AKS and walk through a complete code-to-deployment example,
259231
[az-group-create]: /cli/azure/group#az-group-create
260232
[az-group-delete]: /cli/azure/group#az-group-delete
261233
[azd-install]: /azure/developer/azure-developer-cli/install-azd
234+
[azd-init]: /azure/developer/azure-developer-cli/init-azd
235+
[azd-up]: /azure/developer/azure-developer-cli/up-azd
236+
[az-auth-login]: /azure/developer/azure-developer-cli/auth-azd
262237
[kubernetes-concepts]: ../concepts-clusters-workloads.md
263238
[kubernetes-deployment]: ../concepts-clusters-workloads.md#deployments-and-yaml-manifests
264239
[aks-solution-guidance]: /azure/architecture/reference-architectures/containers/aks-start-here?toc=/azure/aks/toc.json&bc=/azure/aks/breadcrumb/toc.json

0 commit comments

Comments
 (0)