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: examples/dts/README.md
+29-1Lines changed: 29 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,13 @@ This directory contains examples of how to author durable orchestrations using t
4
4
5
5
## Prerequisites
6
6
7
-
All the examples assume that you have a Durable Task Scheduler taskhub created.
7
+
There are 2 separate ways to run an example:
8
+
1. Using the emulator.
9
+
2. Using a real scheduler and taskhub.
8
10
11
+
All the examples by defualt assume that you have a Durable Task Scheduler taskhub created.
12
+
13
+
## Running with a scheduler and taskhub resource
9
14
The simplest way to create a taskhub is by using the az cli commands:
10
15
11
16
1. Create a scheduler:
@@ -46,6 +51,29 @@ The simplest way to create a taskhub is by using the az cli commands:
46
51
47
52
1. Grant yourself the `Durable Task Data Contributor` role over your scheduler
48
53
54
+
## Running with the emulator
55
+
The emulator is a simulation of a scheduler and taskhub. It is the 'backend' of the durabletask-azuremanaged system packaged up into an easy to use docker container. For these steps, it is assumed that you are using port 8080.
56
+
57
+
In order to use the emulator for the examples, perform the following steps:
3. Run the emulator and wait a few seconds for the container to be ready:
64
+
`docker run --name dtsemulator -d -p 8080:8080 mcr.microsoft.com/dts/dts-emulator:v0.0.4`
65
+
66
+
4. Set the environment variables that are referenced and used in the examples:
67
+
1. If you are using windows powershell:
68
+
`$env:TASKHUB=default`
69
+
`$env:ENDPOINT=http://localhost:8080`
70
+
2. If you are using bash:
71
+
`export TASKHUB=default`
72
+
`export ENDPOINT=http://localhost:8080`
73
+
74
+
5. Finally, edit the examples to change the `token_credential` input of both the `DurableTaskSchedulerWorker` and `DurableTaskSchedulerClient` to a value of `None`
75
+
76
+
49
77
## Running the examples
50
78
51
79
Now, you can simply execute any of the examples in this directory using `python3`:
0 commit comments