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
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ Understanding this distinction is crucial for orchestration versioning, where th
37
37
-**Minimal configuration**: Built-in feature requiring only basic `host.json` configuration.
38
38
-**Backend agnostic**: Feature can be used by apps leveraging any of the Durable Function's [storage backends](durable-functions-storage-providers.md).
39
39
40
-
### How It Works
40
+
### How it works
41
41
42
42
The Orchestration Versioning feature operates on these core principles:
43
43
@@ -57,7 +57,7 @@ The Orchestration Versioning feature operates on these core principles:
57
57
58
58
The most common use case for Orchestration Versioning is when you need to make breaking changes to your orchestrator logic while keeping existing in-flight orchestration instances running with their original version. All you need to do is update the `defaultVersion` in your `host.json` and modify your orchestrator code to check the orchestration version and branch execution accordingly. Let's walk through the required steps.
59
59
60
-
### Step 1: defaultVersion Configuration
60
+
### Step 1: defaultVersion configuration
61
61
62
62
To configure the default version for your orchestrations, you need to add or update the `defaultVersion` setting in the `host.json` file in your Azure Functions project:
63
63
@@ -79,7 +79,7 @@ The version string can follow any format that suits your versioning strategy:
79
79
80
80
After you set the `defaultVersion`, all new orchestration instances will be permanently associated with that version.
81
81
82
-
### Step 2: Orchestrator Function Logic
82
+
### Step 2: Orchestrator function logic
83
83
84
84
To implement version-aware logic in your orchestrator function, you can use the context parameter passed to the orchestrator to access the current orchestration instance's version, which allows you to branch your orchestrator logic based on the version.
85
85
@@ -118,7 +118,7 @@ public static async Task<string> RunOrchestrator(
118
118
> [!TIP]
119
119
> Depending on your situation, you may prefer branching on different levels. You can make a local change precisely where this change is required, like the example shows. Alternatively, you can branch at a higher level, even at the entire orchestrator implementation level, which introduces some code duplication, but may keep the execution flow clear. It's up to you to choose the approach that best fits your scenario and coding style.
120
120
121
-
### What Happens After Deployment
121
+
### What happens after deployment
122
122
123
123
Here's what to expect once you deploy your updated orchestrator function with the new version logic:
124
124
@@ -136,7 +136,7 @@ Here's what to expect once you deploy your updated orchestrator function with th
136
136
> [!NOTE]
137
137
> The behavior described in this section targets the most common situations, and this is what the default configuration provides. However, it can be modified if needed (see [Advanced usage](#advanced-usage) for details).
138
138
139
-
### Example: Replacing an Activity in the Sequence
139
+
### Example: Replacing an activity in the sequence
140
140
141
141
This example shows how to replace one activity with a different activity in the middle of a sequence using Orchestration Versioning.
142
142
@@ -227,7 +227,7 @@ For more sophisticated versioning scenarios, you can configure other settings to
227
227
> [!TIP]
228
228
> Use the default configuration (`CurrentOrOlder` with `Reject`) for most scenarios to enable safe rolling deployments while preserving orchestration state during version transitions. We recommend proceeding with the advanced configuration only if you have specific requirements that can't be met with the default behavior.
229
229
230
-
### Version Matching
230
+
### Version matching
231
231
232
232
The `versionMatchStrategy` setting determines how the runtime matches orchestration versions when loading orchestrator functions. It controls which orchestration instances a worker can process based on version compatibility.
233
233
@@ -260,7 +260,7 @@ When the `CurrentOrOlder` strategy is selected, the runtime compares the orchest
260
260
3. If both versions can be parsed as `System.Version`, semantic comparison is used.
261
261
4. Otherwise, case-insensitive string comparison is performed.
262
262
263
-
### Version Mismatch Handling
263
+
### Version mismatch handling
264
264
265
265
The `versionFailureStrategy` setting determines what happens when an orchestration instance version doesn't match the current `defaultVersion`.
266
266
@@ -282,7 +282,7 @@ The `versionFailureStrategy` setting determines what happens when an orchestrati
282
282
283
283
-**`Fail`**: Fail the orchestration. This strategy immediately terminates the orchestration instance with a failure state, which may be appropriate in scenarios where version mismatches indicate serious deployment issues.
284
284
285
-
### Starting New Orchestrations with Specific Versions
285
+
### Starting new orchestrations with specific versions
286
286
287
287
By default, all new orchestration instances are created with the current `defaultVersion` specified in your `host.json` configuration. However, you may have scenarios where you need to create orchestrations with a specific version, even if it differs from the current default.
288
288
@@ -319,7 +319,7 @@ public static async Task<HttpResponseData> HttpStart(
319
319
> [!NOTE]
320
320
> When you specify a version explicitly during orchestration creation, that version takes precedence over the `defaultVersion` in `host.json`. The orchestration instance will be permanently associated with the specified version, regardless of any future changes to the default version.
321
321
322
-
### Removing Legacy Code Paths
322
+
### Removing legacy code paths
323
323
324
324
Over time, you may want to remove legacy code paths from your orchestrator functions to simplify maintenance and reduce technical debt. However, removing code must be done carefully to avoid breaking existing orchestration instances.
325
325
@@ -340,27 +340,27 @@ Over time, you may want to remove legacy code paths from your orchestrator funct
340
340
341
341
## Best practices
342
342
343
-
### Version Management
343
+
### Version management
344
344
345
345
1.**Use semantic versioning**: Adopt a consistent versioning scheme like `major.minor.patch`.
346
346
1.**Document breaking changes**: Clearly document what changes require a new version.
347
347
1.**Plan version lifecycle**: Define when to remove legacy code paths.
348
348
349
-
### Code Organization
349
+
### Code organization
350
350
351
351
1.**Separate version logic**: Use clear branching or separate methods for different versions.
352
352
1.**Preserve determinism**: Never modify existing version logic once deployed.
353
353
1.**Test thoroughly**: Test all version paths, especially during transitions.
354
354
355
-
### Monitoring and Observability
355
+
### Monitoring and observability
356
356
357
357
1.**Log version information**: Include version in your logging for easier debugging.
358
358
1.**Monitor version distribution**: Track which versions are actively running.
359
359
1.**Set up alerts**: Monitor for any version-related errors.
360
360
361
361
## Troubleshooting
362
362
363
-
### Common Issues
363
+
### Common issues
364
364
365
365
-**Issue**: Orchestration instances created with version 1.0 are failing after deploying version 2.0
366
366
-**Solution**: Ensure the version 1.0 code path in your orchestrator remains exactly the same. Any changes to the execution sequence may break deterministic replay.
0 commit comments