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
This directory contains a Function app that demonstrates how to make changes to an orchestrator function without breaking existing orchestration instances.
4
+
5
+
The orchestrator function has two code paths:
6
+
7
+
1. The old path invoking `activity_a`.
8
+
2. The new path invoking `activity_b` instead.
9
+
10
+
While `defaultVersion` in `host.json` is set to `1.0`, the orchestrator will always follow the first path, producing the following output:
11
+
12
+
```
13
+
Orchestration version: 1.0
14
+
Suborchestration version: 1.0
15
+
Hello from A!
16
+
```
17
+
18
+
When `defaultVersion` in `host.json` is updated (for example, to `2.0`), *new orchestration instances* will follow the new path, producing the following output:
19
+
20
+
```
21
+
Orchestration version: 2.0
22
+
Suborchestration version: 2.0
23
+
Hello from B!
24
+
```
25
+
26
+
What happens to existing orchestration instances that were started before the `defaultVersion` change? Waiting for an external event in the middle of the orchestrator provides a convenient opportunity to emulate a deployment while orchestration instances are still running:
27
+
28
+
1. Create a new orchestration by invoking the HTTP trigger (`http_start`).
29
+
2. Wait for the orchestration to reach the point where it is waiting for an external event.
30
+
3. Stop the app.
31
+
4. Change `defaultVersion` in `host.json` to `2.0`.
32
+
5. Deploy and start the updated app.
33
+
6. Trigger the external event.
34
+
7. Observe that the orchestration output.
35
+
36
+
```
37
+
Orchestration version: 1.0
38
+
Suborchestration version: 2.0
39
+
Hello from A!
40
+
```
41
+
42
+
Note that the value returned by `context.version` is permanently associated with the orchestrator instance and is not impacted by the `defaultVersion` change. As a result, the orchestrator follows the old execution path to guarantee deterministic replay behavior.
43
+
44
+
However, the suborchestration version is `2.0` because it was invoked this suborchestration was created *after* the `defaultVersion` change.
0 commit comments