You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/aks/includes/azd/azd-login-ts.md
+15-22Lines changed: 15 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,41 +1,33 @@
1
1
---
2
2
ms.service: azure-kubernetes-service
3
3
ms.topic: include
4
-
ms.date: 02/21/2024
4
+
ms.date: 03/15/2024
5
5
---
6
6
7
7
### azd auth workaround
8
8
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.
11
10
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`.
15
12
16
13
```azurecli-interactive
17
14
az login --scope https://graph.microsoft.com/.default
18
15
```
19
16
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:
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.
33
25
34
26
```console
35
27
curl <localhost>
36
28
```
37
29
38
-
A successful login outputs an HTML webpage:
30
+
A successful login outputs an HTML webpage, as shown in the following example:
39
31
40
32
```output
41
33
<!DOCTYPE html>
@@ -73,14 +65,15 @@ This workaround requires you to have the [Azure CLI][install-azure-cli] and run
73
65
</html>
74
66
```
75
67
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.
Copy file name to clipboardExpand all lines: articles/aks/learn/quick-kubernetes-deploy-azd.md
+51-76Lines changed: 51 additions & 76 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,23 @@
1
1
---
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.
#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.
8
10
---
9
11
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
11
13
12
14
Azure Kubernetes Service (AKS) is a managed Kubernetes service that lets you quickly deploy and manage clusters. In this quickstart, you learn to:
13
15
14
16
- Download and install the Azure Developer CLI (`azd`).
15
17
- Clone applications from an Azure Developer CLI template (`azd` template).
16
18
- Deploy an AKS cluster using the Azure Developer CLI (`azd`).
17
19
- 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.
19
21
20
22
> [!NOTE]
21
23
> 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
29
31
- 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).
30
32
31
33
- 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.
32
35
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
34
37
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).
39
39
40
40
The quickstart application includes the following Kubernetes deployments and services:
41
41
@@ -49,17 +49,15 @@ The quickstart application includes the following Kubernetes deployments and ser
49
49
> [!NOTE]
50
50
> 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.
51
51
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
55
53
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.
57
55
58
56
```azdeveloper
59
57
azd init --template Azure-Samples/aks-store-demo
60
58
```
61
59
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*.
63
61
64
62
```output
65
63
Enter a new environment name: aks-azdqs-1
@@ -69,24 +67,25 @@ The quickstart application includes the following Kubernetes deployments and ser
69
67
70
68
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.
71
69
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.
73
71
74
72
```azdeveloper
75
73
azd auth login
76
74
```
77
75
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 signin.
79
77
80
78
```output
81
79
Start by copying the next code: XXXXXXXXX
82
80
Then press enter and continue to log in from your browser...
83
81
```
84
82
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].
86
85
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.
90
89
91
90
```output
92
91
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
98
97
99
98
## Create and deploy resources for your cluster
100
99
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.
104
101
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
110
103
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.
112
105
113
106
```azdeveloper
114
107
azd up
115
108
```
116
109
117
-
1. Select an Azure subscription for your billing usage.
110
+
2. Select an Azure subscription for your billing usage.
118
111
119
112
```output
120
113
? Select an Azure Subscription to use: [Use arrows to move, type to filter]
121
114
> 1. My Azure Subscription (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
122
115
```
123
116
124
-
1. Select a region to deploy your application to.
117
+
3. Select a region to deploy your application to.
125
118
126
119
```output
127
120
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)
131
124
> 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)
135
128
```
136
129
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:
138
131
139
132
```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.
141
134
```
142
135
143
136
## Test the application
144
137
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.
146
139
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.
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.
154
147
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.
175
149
176
150
```console
177
151
kubectl get service store-front --watch
@@ -184,7 +158,7 @@ When your application is created, a Kubernetes service exposes the application's
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.
197
171
198
172
:::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":::
199
173
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
-
204
174
## Delete the cluster
205
175
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.
207
177
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.
209
179
210
180
```azdeveloper
211
181
azd down
212
182
```
213
183
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`.
215
185
216
186
```output
217
187
? Total resources to delete: 14, are you sure you want to continue? (y/N)
218
188
```
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`.
221
191
222
192
```output
223
193
[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.
224
194
225
195
? Would you like to permanently delete these resources instead, allowing their names to be reused? (y/N)
226
196
```
227
197
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:
229
199
230
200
```output
231
201
SUCCESS: Your application was removed from Azure in 14 minutes 30 seconds.
232
202
```
233
203
234
204
> [!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.
236
206
> For guidance on creating full solutions with AKS for production, see [AKS solution guidance][aks-solution-guidance].
237
207
238
208
## Next steps
@@ -248,6 +218,8 @@ To learn more about AKS and walk through a complete code-to-deployment example,
0 commit comments