Skip to content

Commit 7d276d9

Browse files
committed
update to draft and add to toc
Signed-off-by: Hannah Hunter <[email protected]>
1 parent f652cae commit 7d276d9

File tree

2 files changed

+77
-7
lines changed

2 files changed

+77
-7
lines changed

articles/aks/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,8 @@
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
544+
href: dapr-workflow.md
543545
- name: Troubleshoot the Dapr extension
544546
href: dapr-troubleshooting.md
545547
- name: Use GitOps

articles/aks/dapr-workflow.md

Lines changed: 75 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ The workflow example is an ASP.NET Core project with:
3131
3232
## Pre-requisites
3333

34-
- If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
35-
- Install the latest version of the [Azure CLI][install-cli].
36-
- If you don't have one already, create an [AKS cluster][deploy-cluster].
37-
- Make sure you have [an Azure Kubernetes Service RBAC Admin role](../role-based-access-control/built-in-roles.md#azure-kubernetes-service-rbac-admin)
34+
- An Azure subscription. [Don't have one? Create a free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F)
35+
- The latest version of the [Azure CLI][install-cli]
36+
- Create an [AKS cluster][deploy-cluster]
37+
- [An Azure Kubernetes Service RBAC Admin role](../role-based-access-control/built-in-roles.md#azure-kubernetes-service-rbac-admin)
38+
- Log into [ghcr.io][gh-pat] using your GitHub Personal Access Token to authenticate to the container registry.
3839
- Install .NET 6+
3940
- Install Docker
4041

@@ -52,24 +53,91 @@ Navigate to the root directory.
5253
cd dapr-workflows-aks-sample
5354
```
5455

56+
If you haven't already, log into [ghcr.io][gh-pat].
57+
5558
## Prepare the Docker image
5659

57-
When getting ready to build and push the Docker image, make sure you're logged into ghcr.io
60+
Run the following commands to build and push the Docker image for the application.
61+
62+
```sh
63+
docker build -t ghcr.io/shubham1172/dwf-sample:0.1.0 -f Deploy/Dockerfile .
64+
docker push ghcr.io/shubham1172/dwf-sample:0.1.0
65+
```
66+
67+
## Install Dapr on your AKS cluster
68+
69+
Once you've built the Docker image, install the Dapr extension on your AKS cluster. Before you do this, make sure you've [installed or updated the `k8s-extension`][k8s-ext].
70+
71+
```sh
72+
az k8s-extension create --cluster-type managedClusters \
73+
--cluster-name <myAKSCluster> \
74+
--resource-group <myResourceGroup> \
75+
--name dapr \
76+
--extension-type Microsoft.Dapr
77+
```
5878

5979
## Deploy to AKS
6080

81+
Run the following commands to the cluster:
82+
83+
- Install the Redis state store component and the sample app
84+
- Expose the Dapr sidecar and the sample app
85+
86+
**Install Redis**
87+
88+
```sh
89+
helm repo add bitnami https://charts.bitnami.com/bitnami
90+
helm install redis bitnami/redis
91+
k apply -f Deploy/redis.yaml
92+
```
93+
94+
**Install the sample app**
95+
96+
```sh
97+
k apply -f Deploy/deployment.yaml
98+
```
99+
100+
**Expose the Dapr sidecar and the sample app**
101+
102+
```sh
103+
k apply -f Deploy/service.yaml
104+
export SAMPLE_APP_URL=$(k get svc/workflows-sample -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
105+
export DAPR_URL=$(k get svc/workflows-sample-dapr -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
106+
```
107+
61108
## Run the workflow
62109

63-
## Clean up resources
110+
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:
111+
112+
```sh
113+
curl -X GET $SAMPLE_APP_URL/stock/restock
114+
```
115+
116+
Start the workflow:
117+
118+
```sh
119+
curl -i -X POST $DAPR_URL/v1.0-alpha1/workflows/dapr/OrderProcessingWorkflow/1234/start \
120+
-H "Content-Type: application/json" \
121+
-d '{ "input" : {"Name": "Paperclips", "TotalCost": 99.95, "Quantity": 1}}'
122+
```
123+
124+
Check the workflow status:
125+
126+
```sh
127+
curl -i -X GET $DAPR_URL/v1.0-alpha1/workflows/dapr/OrderProcessingWorkflow/1234
128+
```
64129

65130
## Next steps
66131

67132
<!-- Links Internal -->
68-
133+
[deploy-cluster]: ./tutorial-kubernetes-deploy-cluster.md
134+
[install-cli]: /cli/azure/install-azure-cli
135+
[k8s-ext]: ./dapr.md#set-up-the-azure-cli-extension-for-cluster-extensions
69136

70137
<!-- Links External -->
71138
[dapr-workflow-sample]: https://github.com/shubham1172/dapr-workflows-aks-sample
72139
[dapr-program]: https://github.com/shubham1172/dapr-workflows-aks-sample/blob/main/Program.cs
73140
[dapr-workflow-dir]: https://github.com/shubham1172/dapr-workflows-aks-sample/tree/main/Workflows
74141
[dapr-activities-dir]: https://github.com/shubham1172/dapr-workflows-aks-sample/tree/main/Activities
75142
[dapr-workflow-alpha]: https://docs.dapr.io/operations/support/support-preview-features/#current-preview-features
143+
[gh-pat]: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#authenticating-with-a-personal-access-token-classic

0 commit comments

Comments
 (0)