Skip to content

Commit 7a31db1

Browse files
Merge pull request #306614 from AnatoliB/anatolib/override-orch-version
Add Python, JavaScript, and PowerShell samples for overriding orchestration version
2 parents 41d2e19 + 7c1984e commit 7a31db1

1 file changed

Lines changed: 58 additions & 13 deletions

File tree

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

Lines changed: 58 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,39 +43,41 @@ The orchestration versioning feature operates on these core principles:
4343

4444
Before using orchestration versioning, ensure you have the required package versions for your programming language.
4545

46-
If you're using a non-.NET language (JavaScript, Python, PowerShell, or Java) with [extension bundles](../extension-bundles.md), your function app must reference **Extension Bundle version 4.26.0 or later**. Configure the `extensionBundle` range in `host.json` so that the minimum version is at least `4.26.0`, for example:
46+
If you're using a non-.NET language (JavaScript, Python, PowerShell, or Java) with [extension bundles](../extension-bundles.md), your function app must reference **Extension Bundle version 4.30.0 or later**. Configure the `extensionBundle` range in `host.json` so that the minimum version is at least `4.30.0`, for example:
4747

4848
```json
4949
{
5050
"version": "2.0",
5151
"extensionBundle": {
5252
"id": "Microsoft.Azure.Functions.ExtensionBundle",
53-
"version": "[4.26.0, 5.0.0)"
53+
"version": "[4.30.0, 5.0.0)"
5454
}
5555
}
5656
```
5757

5858
See the [extension bundle configuration documentation](../extension-bundles.md) for details on choosing and updating bundle versions.
5959

60+
In addition to the extension bundle requirement for non-.NET languages, you also need to use the minimum version of the language-specific SDK package listed below. Both the extension bundle and the SDK package are required for orchestration versioning to work correctly.
61+
6062
# [C#](#tab/csharp)
6163

62-
Use `Microsoft.Azure.Functions.Worker.Extensions.DurableTask` version [1.5.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.5.0) or later.
64+
Use `Microsoft.Azure.Functions.Worker.Extensions.DurableTask` version [1.14.0](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Extensions.DurableTask/1.14.0) or later.
6365

6466
# [JavaScript](#tab/javascript)
6567

66-
Use `durable-functions` version [3.2.0](https://www.npmjs.com/package/durable-functions/v/3.2.0) or later.
68+
Use `durable-functions` version [3.3.0](https://www.npmjs.com/package/durable-functions/v/3.3.0) or later.
6769

6870
# [Python](#tab/python)
6971

70-
Use `azure-functions-durable` version [1.3.3](https://pypi.org/project/azure-functions-durable/1.3.3/) or later.
72+
Use `azure-functions-durable` version [1.5.0](https://pypi.org/project/azure-functions-durable/1.5.0/) or later.
7173

7274
# [PowerShell](#tab/powershell)
7375

74-
Use `AzureFunctions.PowerShell.Durable.SDK` version [2.0.0](https://www.powershellgallery.com/packages/AzureFunctions.PowerShell.Durable.SDK/2.0.0) or later. Make sure you're using the standalone [Durable Functions PowerShell SDK](durable-functions-powershell-v2-sdk-migration-guide.md).
76+
Use `AzureFunctions.PowerShell.Durable.SDK` version [2.2.0](https://www.powershellgallery.com/packages/AzureFunctions.PowerShell.Durable.SDK/2.2.0) or later. Make sure you're using the standalone [Durable Functions PowerShell SDK](durable-functions-powershell-v2-sdk-migration-guide.md).
7577

7678
# [Java](#tab/java)
7779

78-
Use `durabletask-azure-functions` version [1.6.1](https://mvnrepository.com/artifact/com.microsoft/durabletask-azure-functions/1.6.1) or later.
80+
Use `durabletask-azure-functions` version [1.6.3](https://mvnrepository.com/artifact/com.microsoft/durabletask-azure-functions/1.6.3) or later.
7981

8082
---
8183

@@ -633,16 +635,36 @@ public static async Task<HttpResponseData> HttpStart(
633635
```
634636

635637
# [JavaScript](#tab/javascript)
638+
```javascript
639+
const HttpStart: HttpHandler = async (request: HttpRequest, context: InvocationContext): Promise<HttpResponse> => {
640+
const client = df.getClient(context);
641+
const instanceId = await client.startNew("ProcessOrderOrchestrator", {
642+
input: orderId,
643+
version: "1.0"
644+
});
636645

637-
Starting an orchestration with a specific version different from the current `defaultVersion` specified in your `host.json` is currently not supported in JavaScript.
646+
// ...
647+
};
648+
```
638649

639650
# [Python](#tab/python)
651+
```python
652+
@myApp.route(route="orchestrators/{functionName}")
653+
@myApp.durable_client_input(client_name="client")
654+
async def http_start(req: func.HttpRequest, client):
655+
instance_id = await client.start_new("ProcessOrderOrchestrator", client_input=order_id, version="1.0")
640656

641-
Starting an orchestration with a specific version different from the current `defaultVersion` specified in your `host.json` is currently not supported in Python.
657+
# ...
658+
```
642659

643660
# [PowerShell](#tab/powershell)
661+
```powershell
662+
param($Request, $TriggerMetadata)
663+
664+
$instanceId = Start-DurableOrchestration -FunctionName "ProcessOrderOrchestrator" -Input $orderId -Version "1.0"
644665
645-
Starting an orchestration with a specific version different from the current `defaultVersion` specified in your `host.json` is currently not supported in PowerShell.
666+
# ...
667+
```
646668

647669
# [Java](#tab/java)
648670

@@ -688,16 +710,39 @@ public static async Task<string> RunMainOrchestrator(
688710
```
689711

690712
# [JavaScript](#tab/javascript)
713+
```javascript
714+
const RunMainOrchestrator: OrchestrationHandler = function* (context: OrchestrationContext) {
715+
const paymentResult = yield context.df.callSubOrchestrator(
716+
"ProcessPaymentOrchestrator",
717+
orderId,
718+
{ version: "1.0" }
719+
);
691720

692-
Starting a sub-orchestration with a specific version different from the current `defaultVersion` specified in your `host.json` is currently not supported in JavaScript.
721+
// ...
722+
};
723+
```
693724

694725
# [Python](#tab/python)
726+
```python
727+
@myApp.orchestration_trigger(context_name="context")
728+
def run_main_orchestrator(context: df.DurableOrchestrationContext):
729+
payment_result = yield context.call_sub_orchestrator(
730+
"ProcessPaymentOrchestrator",
731+
order_id,
732+
version="1.0"
733+
)
695734

696-
Starting a sub-orchestration with a specific version different from the current `defaultVersion` specified in your `host.json` is currently not supported in Python.
735+
# ...
736+
```
697737

698738
# [PowerShell](#tab/powershell)
739+
```powershell
740+
param($Context)
741+
742+
$paymentResult = Invoke-SubOrchestrator -FunctionName "ProcessPaymentOrchestrator" -Input $orderId -Version "1.0"
699743
700-
Starting a sub-orchestration with a specific version different from the current `defaultVersion` specified in your `host.json` is currently not supported in PowerShell.
744+
# ...
745+
```
701746

702747
# [Java](#tab/java)
703748

0 commit comments

Comments
 (0)