Skip to content

Commit ed48411

Browse files
Merge pull request #271773 from bachuv/vabachu/df-callhttp-dotnet-isolated-updates
DF .NET Isolated HTTP API updates
2 parents 64bf41f + badc921 commit ed48411

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

articles/azure-functions/durable/durable-functions-orchestrations.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,25 @@ public static async Task CheckSiteAvailable(
310310

311311
# [C# (Isolated)](#tab/csharp-isolated)
312312

313-
The feature is not currently supported in dotnet-isolated worker. Instead, write an activity which performs the desired HTTP call.
313+
To simplify this common pattern, orchestrator functions can use the `CallHttpAsync` method to invoke HTTP APIs directly. For C# (Isolated), this feature was introduced in Microsoft.Azure.Functions.Worker.Extensions.DurableTask v1.1.0.
314+
315+
```csharp
316+
[Function("CheckSiteAvailable")]
317+
public static async Task CheckSiteAvailable(
318+
[OrchestrationTrigger] TaskOrchestrationContext context)
319+
{
320+
Uri url = context.GetInput<Uri>();
321+
322+
// Makes an HTTP GET request to the specified endpoint
323+
DurableHttpResponse response =
324+
await context.CallHttpAsync(HttpMethod.Get, url);
325+
326+
if ((int)response.StatusCode == 400)
327+
{
328+
// handling of error codes goes here
329+
}
330+
}
331+
```
314332

315333
# [JavaScript (PM3)](#tab/javascript-v3)
316334

0 commit comments

Comments
 (0)