Skip to content

Commit b11fb0d

Browse files
committed
Move version comparison rules
1 parent 979f123 commit b11fb0d

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

articles/azure-functions/durable/durable-functions-orchestration-versioning.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,22 @@ To configure the default version for your orchestrations, you need to add or upd
6868
```
6969

7070
The version string can follow any format that suits your versioning strategy:
71-
- Multi-part versioning: `"1.0.0"`, `"2.1.0"` (compared in decreasing order of component importance, similar to semantic versioning)
72-
- Simple numbering: `"1"`, `"2"` (compared as numbers)
73-
- Date-based: `"2025-01-01"` (compared lexicographically)
74-
- Custom format: `"v1.0-release"` (compared lexicographically)
75-
76-
For more details about how different version formats are compared, see [Version comparison rules](#version-comparison-rules).
71+
- Multi-part versioning: `"1.0.0"`, `"2.1.0"`
72+
- Simple numbering: `"1"`, `"2"`
73+
- Date-based: `"2025-01-01"`
74+
- Custom format: `"v1.0-release"`
7775

7876
After you set the `defaultVersion`, all new orchestration instances will be permanently associated with that version.
7977

78+
### Version comparison rules
79+
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+
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.
86+
8087
### Step 2: Orchestrator function logic
8188

8289
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.
@@ -250,15 +257,6 @@ The `versionMatchStrategy` setting determines how the runtime matches orchestrat
250257

251258
- **`CurrentOrOlder`** (default): Process tasks from orchestrations whose version is less than or equal to the version specified by `defaultVersion` in the worker's `host.json`. This strategy enables backward compatibility, allowing newer workers to handle orchestrations started by older orchestrator versions while preventing older workers from processing newer orchestrations.
252259

253-
### Version comparison rules
254-
255-
When the `Strict` or `CurrentOrOlder` strategy is selected, the runtime compares the orchestration instance's version with the `defaultVersion` value of the worker using the following rules:
256-
257-
1. Empty or null versions are treated as equal.
258-
2. An empty or null version is considered older than any defined version.
259-
3. If both versions can be parsed as `System.Version`, the `CompareTo` method is used.
260-
4. Otherwise, case-insensitive string comparison is performed.
261-
262260
### Version mismatch handling
263261

264262
The `versionFailureStrategy` setting determines what happens when an orchestration instance version doesn't match the current `defaultVersion`.

0 commit comments

Comments
 (0)