Skip to content

Commit 2e0a745

Browse files
committed
small updates from chris and shubham
Signed-off-by: Hannah Hunter <[email protected]>
1 parent c6d40ad commit 2e0a745

File tree

2 files changed

+53
-39
lines changed

2 files changed

+53
-39
lines changed

articles/aks/TOC.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@
540540
href: dapr-settings.md
541541
- name: Migrate from Dapr OSS to the Dapr extension
542542
href: dapr-migration.md
543-
- name: Manage workflows with the Dapr extension
543+
- name: Deploy and run workflows with the Dapr extension
544544
href: dapr-workflow.md
545545
- name: Troubleshoot the Dapr extension
546546
href: dapr-troubleshooting.md

articles/aks/dapr-workflow.md

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
---
2-
title: Manage workflows with the Dapr extension for Azure Kubernetes Service (AKS)
3-
description: Learn how to run and manage Dapr Workflow on your Azure Kubernetes Service (AKS) clusters via the Dapr extension.
2+
title: Deploy and run workflows with the Dapr extension for Azure Kubernetes Service (AKS)
3+
description: Learn how to deploy and run Dapr Workflow on your Azure Kubernetes Service (AKS) clusters via the Dapr extension.
44
author: hhunter-ms
55
ms.author: hannahhunter
66
ms.reviewer: nuversky
77
ms.service: azure-kubernetes-service
88
ms.topic: article
9-
ms.date: 03/03/2023
9+
ms.date: 03/06/2023
1010
ms.custom: devx-track-azurecli
1111
---
1212

1313
# Manage workflows with the Dapr extension for Azure Kubernetes Service (AKS)
1414

1515
With the Dapr Workflow API, you can easily orchestrate messaging, state management, and failure-handling logic across various microservices. Dapr Workflow can help you create long-running, fault-tolerant, and stateful applications.
1616

17-
In this guide, you'll use the [provided order processing workflow example][dapr-workflow-sample] to:
17+
In this guide, you use the [provided order processing workflow example][dapr-workflow-sample] to:
1818

1919
> [!div class="checklist"]
20+
> - Create an Azure Container Registry and an AKS cluster for this sample.
2021
> - Install the Dapr extension on your AKS cluster.
2122
> - Deploy the sample application to AKS.
22-
> - Start and query workflow instances using API calls.
23+
> - Start and query workflow instances using HTTP API calls.
2324
2425
The workflow example is an ASP.NET Core project with:
2526
- A [`Program.cs` file][dapr-program] that contains the setup of the app, including the registration of the workflow and workflow activities.
@@ -56,8 +57,8 @@ cd dapr-workflows-aks-sample
5657
Run the following commands to test that the Docker image works for the application.
5758

5859
```sh
59-
docker build -t ghcr.io/<your-repo>/dwf-sample:0.1.0 -f Deploy/Dockerfile .
60-
docker push ghcr.io/<your-repo>/dwf-sample:0.1.0
60+
docker build -t ghcr.io/<your-repo>/workflows-sample:0.1.0 -f Deploy/Dockerfile .
61+
docker push ghcr.io/<your-repo>/workflows-sample:0.1.0
6162
```
6263

6364
### Create an Azure Container Registry
@@ -80,11 +81,11 @@ acrName.azurecr.io
8081
Tag the [Docker image](#prepare-the-docker-image) you prepared earlier to your new ACR using the result from the ACR query:
8182

8283
```sh
83-
docker tag ghcr.io/<your-repo>/dwf-sample:0.1.0 acrName.azurecr.io/dwf-sample:0.1.0
84-
docker push acrName.azurecr.io/dwf-sample:0.1.0
84+
docker tag ghcr.io/<your-repo>/workflows-sample:0.1.0 acrName.azurecr.io/workflows-sample:0.1.0
85+
docker push acrName.azurecr.io/workflows-sample:0.1.0
8586
```
8687

87-
For more details, see the [Deploy and use ACR][acr] tutorial.
88+
For more information, see the [Deploy and use ACR][acr] tutorial.
8889

8990
### Create a Kubernetes cluster
9091

@@ -102,7 +103,7 @@ For more information, see the [Deploy an AKS cluster][cluster] tutorial.
102103

103104
### Update the containers for deployment
104105

105-
Navigate to the [`deployment.yaml` file in your fork of the sample project][deployment-yaml] and open in your chosen code editor.
106+
Navigate to the [`deployment.yaml` file in your fork of the sample project][deployment-yaml] and open in your preferred code editor.
106107

107108
```sh
108109
cd Deploy
@@ -113,15 +114,15 @@ In the `deployment.yaml` file, update the `containers` spec value to your new AC
113114

114115
```yaml
115116
containers:
116-
- name: dwf-sample
117-
image: acrName.azurecr.io/dwf-sample:0.1.0
117+
- name: workflows-sample
118+
image: acrName.azurecr.io/workflows-sample:0.1.0
118119
```
119120
120121
Save and close the `deployment.yaml` file.
121122

122123
### Install Dapr on your AKS cluster
123124

124-
Install the Dapr extension on your AKS cluster. Before you do this, make sure you've:
125+
Install the Dapr extension on your AKS cluster. Before you start, make sure you've:
125126
- [Installed or updated the `k8s-extension`][k8s-ext].
126127
- [Registered the `Microsoft.KubernetesConfiguration` service provider][k8s-sp]
127128

@@ -139,40 +140,42 @@ az k8s-extension show --cluster-type managedClusters --cluster-name myAKSCluster
139140
kubectl get pods -A
140141
```
141142

142-
### Run the application
143+
### Deploy the Redis Actor state store component
143144

144-
To run the application, start by navigating to the `Deploy` directory in your forked version of the sample:
145+
Navigate to the `Deploy` directory in your forked version of the sample:
145146

146147
```sh
147148
cd Deploy
148149
```
149150

150-
Run Redis:
151+
Deploy the Redis component:
151152

152153
```sh
153154
helm repo add bitnami https://charts.bitnami.com/bitnami
154155
helm install redis bitnami/redis
155156
kubectl apply -f redis.yaml
156157
```
157158

158-
Run the application:
159+
### Run the application
160+
161+
Once you've deployed Redis, deploy the application to AKS:
159162

160163
```sh
161164
kubectl apply -f deployment.yaml
162165
```
163166

164-
Expose the Dapr sidecar and the sample app
167+
Expose the Dapr sidecar and the sample app:
165168

166169
```sh
167170
kubectl apply -f service.yaml
168-
export SAMPLE_APP_URL=$(kubectl get svc/workflows-sample -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
171+
export APP_URL=$(kubectl get svc/workflows-sample -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
169172
export DAPR_URL=$(kubectl get svc/workflows-sample-dapr -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
170173
```
171174

172175
Verify that the above commands were exported:
173176

174177
```sh
175-
echo $SAMPLE_APP_URL
178+
echo $APP_URL
176179
echo $DAPR_URL
177180
```
178181

@@ -181,52 +184,63 @@ echo $DAPR_URL
181184
Now that the application and Dapr have been deployed to the AKS cluster, you can now start and query workflow instances. Begin by making an API call to the sample app to restock items in the inventory:
182185

183186
```sh
184-
curl -X GET $SAMPLE_APP_URL/stock/restock
187+
curl -X GET $APP_URL/stock/restock
185188
```
186189

187190
Start the workflow:
188191

189192
```sh
190-
curl -i -X POST $DAPR_URL/v1.0-alpha1/workflows/dapr/OrderProcessingWorkflow/1234/start \
193+
curl -X POST $DAPR_URL/v1.0-alpha1/workflows/dapr/OrderProcessingWorkflow/1234/start \
191194
-H "Content-Type: application/json" \
192195
-d '{ "input" : {"Name": "Paperclips", "TotalCost": 99.95, "Quantity": 1}}'
193196
```
194197

195198
Expected output:
196199

197200
```json
198-
HTTP/1.1 202 Accepted
199-
Date: Fri, 03 Mar 2023 19:19:15 GMT
200-
Content-Type: application/json
201-
Content-Length: 22
202-
Traceparent: 00-00000000000000000000000000000000-0000000000000000-00
203-
204201
{"instance_id":"1234"}
205202
```
206203

207204
Check the workflow status:
208205

209206
```sh
210-
curl -i -X GET $DAPR_URL/v1.0-alpha1/workflows/dapr/OrderProcessingWorkflow/1234
207+
curl -X GET $DAPR_URL/v1.0-alpha1/workflows/dapr/OrderProcessingWorkflow/1234
211208
```
212209

213210
Expected output:
214211

215212
```json
216-
HTTP/1.1 202 Accepted
217-
Date: Fri, 03 Mar 2023 19:19:44 GMT
218-
Content-Type: application/json
219-
Content-Length: 388
220-
Traceparent: 00-00000000000000000000000000000000-0000000000000000-00
221-
222-
{"WFInfo":{"instance_id":"1234"},"start_time":"2023-03-03T19:19:16Z","metadata":{"dapr.workflow.custom_status":"","dapr.workflow.input":"{\"Name\":\"Paperclips\",\"Quantity\":1,\"TotalCost\":99.95}","dapr.workflow.last_updated":"2023-03-03T19:19:33Z","dapr.workflow.name":"OrderProcessingWorkflow","dapr.workflow.output":"{\"Processed\":true}","dapr.workflow.runtime_status":"COMPLETED"}}
213+
{
214+
"WFInfo":
215+
{
216+
"instance_id":"1234"
217+
},
218+
"start_time":"2023-03-03T19:19:16Z",
219+
"metadata":
220+
{
221+
"dapr.workflow.custom_status":"",
222+
"dapr.workflow.input":"{\"Name\":\"Paperclips\",\"Quantity\":1,\"TotalCost\":99.95}",
223+
"dapr.workflow.last_updated":"2023-03-03T19:19:33Z",
224+
"dapr.workflow.name":"OrderProcessingWorkflow",
225+
"dapr.workflow.output":"{\"Processed\":true}",
226+
"dapr.workflow.runtime_status":"COMPLETED"
227+
}
228+
}
223229
```
224230

225231
Notice that the workflow status is marked as completed.
226232

227233
## Next steps
228234

229-
[Learn how to add configuration settings to the Dapr extension][dapr-config]
235+
In this guide, you deployed and ran workflows on a Dapr extension for AKS. You learned how to:
236+
237+
> [!div class="checklist"]
238+
> - Create an Azure Container Registry and an AKS cluster for this sample.
239+
> - Install the Dapr extension on your AKS cluster.
240+
> - Deploy the sample application to AKS.
241+
> - Start and query workflow instances using HTTP API calls.
242+
243+
[Learn how to add configuration settings to the Dapr extension on your AKS cluster][dapr-config].
230244

231245
<!-- Links Internal -->
232246
[deploy-cluster]: ./tutorial-kubernetes-deploy-cluster.md

0 commit comments

Comments
 (0)