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/azure-functions/durable/durable-functions-orchestration-versioning.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,13 +35,13 @@ Understanding this distinction is crucial for orchestration versioning, where th
35
35
36
36
The orchestration versioning feature operates on these core principles:
37
37
38
-
1.**Version Association**: When an orchestration instance is created, it gets a version permanently associated with it.
38
+
-**Version Association**: When an orchestration instance is created, it gets a version permanently associated with it.
39
39
40
-
1.**Version-aware Execution**: Orchestrator function code can examine the version value associated with the current orchestration instance and branch execution accordingly.
40
+
-**Version-aware Execution**: Orchestrator function code can examine the version value associated with the current orchestration instance and branch execution accordingly.
41
41
42
-
2.**Backward Compatibility**: Workers running newer orchestrator versions can continue executing orchestration instances created by older orchestrator versions.
42
+
-**Backward Compatibility**: Workers running newer orchestrator versions can continue executing orchestration instances created by older orchestrator versions.
43
43
44
-
3.**Forward Protection**: The runtime automatically prevents workers running older orchestrator versions from executing orchestrations started by newer orchestrator versions.
44
+
-**Forward Protection**: The runtime automatically prevents workers running older orchestrator versions from executing orchestrations started by newer orchestrator versions.
45
45
46
46
> [!IMPORTANT]
47
47
> Orchestration versioning is currently in public preview for apps running in the .NET isolated model. Use `Microsoft.Azure.Functions.Worker.Extensions.DurableTask` package version **>=1.5.0**.
@@ -79,10 +79,10 @@ After you set the `defaultVersion`, all new orchestration instances will be perm
79
79
80
80
When the `Strict` or `CurrentOrOlder` strategy is selected (see [Version matching](#version-matching)), the runtime compares the orchestration instance's version with the `defaultVersion` value of the worker using the following rules:
81
81
82
-
1. Empty or null versions are treated as equal.
83
-
2. An empty or null version is considered older than any defined version.
84
-
3. If both versions can be parsed as `System.Version`, the `CompareTo` method is used.
85
-
4. Otherwise, case-insensitive string comparison is performed.
82
+
- Empty or null versions are treated as equal.
83
+
- An empty or null version is considered older than any defined version.
84
+
- If both versions can be parsed as `System.Version`, the `CompareTo` method is used.
85
+
- Otherwise, case-insensitive string comparison is performed.
86
86
87
87
### Step 2: Orchestrator function logic
88
88
@@ -127,13 +127,13 @@ public static async Task<string> RunOrchestrator(
127
127
128
128
Here's what to expect once you deploy your updated orchestrator function with the new version logic:
129
129
130
-
1.**Worker Coexistence**: Workers containing the new orchestrator function code will start, while some workers with the old code are potentially still active.
130
+
-**Worker Coexistence**: Workers containing the new orchestrator function code will start, while some workers with the old code are potentially still active.
131
131
132
-
2.**Version Assignment for New Instances**: All new orchestrations and sub-orchestrations created by the new workers will get the version from `defaultVersion` assigned to them.
132
+
-**Version Assignment for New Instances**: All new orchestrations and sub-orchestrations created by the new workers will get the version from `defaultVersion` assigned to them.
133
133
134
-
3.**New Worker Compatibility**: New workers will be able to process both the newly created orchestrations and the previously existing orchestrations because the changes performed in Step 2 of the previous section ensure backward compatibility through version-aware branching logic.
134
+
-**New Worker Compatibility**: New workers will be able to process both the newly created orchestrations and the previously existing orchestrations because the changes performed in Step 2 of the previous section ensure backward compatibility through version-aware branching logic.
135
135
136
-
4.**Old Worker Restrictions**: Old workers will be allowed to process only the orchestrations with a version _equal to or lower_ than the version specified in their own `defaultVersion` in `host.json`, because they aren't expected to have orchestrator code compatible with newer versions. This restriction prevents execution errors and unexpected behavior.
136
+
-**Old Worker Restrictions**: Old workers will be allowed to process only the orchestrations with a version _equal to or lower_ than the version specified in their own `defaultVersion` in `host.json`, because they aren't expected to have orchestrator code compatible with newer versions. This restriction prevents execution errors and unexpected behavior.
137
137
138
138
> [!NOTE]
139
139
> Orchestration versioning doesn't influence worker lifecycle. The Azure Functions platform manages worker provisioning and decommissioning based on regular rules depending on hosting options.
@@ -323,10 +323,10 @@ Over time, you may want to remove legacy code paths from your orchestrator funct
323
323
- A sufficient time period has passed since the old version was last deployed (considering your business continuity requirements)
324
324
325
325
**Best practices for removal:**
326
-
1.**Monitor actively running instances**: Use the Durable Functions management APIs to query for instances using specific versions.
327
-
2.**Set retention policies**: Define how long you intend to maintain backward compatibility for each version.
328
-
3.**Remove incrementally**: Consider removing one version at a time rather than multiple versions simultaneously.
329
-
4.**Document removal**: Maintain clear records of when versions were removed and why.
326
+
-**Monitor actively running instances**: Use the Durable Functions management APIs to query for instances using specific versions.
327
+
-**Set retention policies**: Define how long you intend to maintain backward compatibility for each version.
328
+
-**Remove incrementally**: Consider removing one version at a time rather than multiple versions simultaneously.
329
+
-**Document removal**: Maintain clear records of when versions were removed and why.
330
330
331
331
> [!WARNING]
332
332
> Removing legacy code paths while orchestration instances are still running those versions may cause deterministic replay failures or unexpected behavior. Always verify that no instances are using the legacy version before removing the code.
@@ -335,21 +335,21 @@ Over time, you may want to remove legacy code paths from your orchestrator funct
335
335
336
336
### Version management
337
337
338
-
1.**Use multi-part versioning**: Adopt a consistent versioning scheme like `major.minor.patch`.
339
-
1.**Document breaking changes**: Clearly document what changes require a new version.
340
-
1.**Plan version lifecycle**: Define when to remove legacy code paths.
338
+
-**Use multi-part versioning**: Adopt a consistent versioning scheme like `major.minor.patch`.
339
+
-**Document breaking changes**: Clearly document what changes require a new version.
340
+
-**Plan version lifecycle**: Define when to remove legacy code paths.
341
341
342
342
### Code organization
343
343
344
-
1.**Separate version logic**: Use clear branching or separate methods for different versions.
345
-
1.**Preserve determinism**: Avoid modifying existing version logic once deployed. If changes are absolutely necessary (such as critical bug fixes), ensure they maintain deterministic behavior and don't alter the sequence of operations, or expect the newer orchestrator versions to fail when processing older orchestrations.
346
-
1.**Test thoroughly**: Test all version paths, especially during transitions.
344
+
-**Separate version logic**: Use clear branching or separate methods for different versions.
345
+
-**Preserve determinism**: Avoid modifying existing version logic once deployed. If changes are absolutely necessary (such as critical bug fixes), ensure they maintain deterministic behavior and don't alter the sequence of operations, or expect the newer orchestrator versions to fail when processing older orchestrations.
346
+
-**Test thoroughly**: Test all version paths, especially during transitions.
347
347
348
348
### Monitoring and observability
349
349
350
-
1.**Log version information**: Include version in your logging for easier debugging.
351
-
1.**Monitor version distribution**: Track which versions are actively running.
352
-
1.**Set up alerts**: Monitor for any version-related errors.
350
+
-**Log version information**: Include version in your logging for easier debugging.
351
+
-**Monitor version distribution**: Track which versions are actively running.
352
+
-**Set up alerts**: Monitor for any version-related errors.
0 commit comments