Skip to content

Commit 5f1d391

Browse files
authored
Update durable-functions-http-features.md
1 parent 8f0ef52 commit 5f1d391

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

articles/azure-functions/durable/durable-functions-http-features.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ For more information on how to manage orchestrations and entities using client A
218218

219219
As described in the [orchestrator function code constraints](durable-functions-code-constraints.md), orchestrator functions can't do I/O directly. Instead, they typically call [activity functions](durable-functions-types-features-overview.md#activity-functions) that do I/O operations.
220220

221-
Starting with Durable Functions 2.0, orchestrations can natively consume HTTP APIs by using the [orchestration trigger binding](durable-functions-bindings.md#orchestration-trigger).
221+
Starting with Durable Functions 2.0, orchestrations can natively consume HTTP APIs by using the [orchestration trigger binding](durable-functions-bindings.md#orchestration-trigger). For C# (Isolated), this feature was introduced in Microsoft.Azure.Functions.Worker.Extensions.DurableTask v1.1.0.
222222

223223
The following example code shows an orchestrator function making an outbound HTTP request:
224224

@@ -242,6 +242,26 @@ public static async Task CheckSiteAvailable(
242242
}
243243
```
244244

245+
# [C# (Isolated)](#tab/csharp-isolated)
246+
247+
```csharp
248+
[Function("CheckSiteAvailable")]
249+
public static async Task CheckSiteAvailable(
250+
[OrchestrationTrigger] TaskOrchestrationContext context)
251+
{
252+
Uri url = context.GetInput<Uri>();
253+
254+
// Makes an HTTP GET request to the specified endpoint
255+
DurableHttpResponse response =
256+
await context.CallHttpAsync(HttpMethod.Get, url);
257+
258+
if ((int)response.StatusCode == 400)
259+
{
260+
// handling of error codes goes here
261+
}
262+
}
263+
```
264+
245265
# [JavaScript](#tab/javascript)
246266

247267
```javascript

0 commit comments

Comments
 (0)