Support for Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer #209
Replies: 4 comments
-
Hey @olahallvall , if you mean Durable Task SQL Provider used in a .NET Isolated project, then yes. VsCode extension should automatically show you your Task Hubs and let you connect to them (no matter if they're from an InProc or Isolated project). Standalone DfMon instance to monitor your Task Hubs can be deployed out of this one or this one (both should work). To inject DfMon into your .NET Isolated + MSSQL project you can just copy-paste code from here. |
Beta Was this translation helpful? Give feedback.
-
Hi again, Below is a Hello World project based on Azure Functions* project type. using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.DurableTask;
using Microsoft.DurableTask.Client;
using Microsoft.Extensions.Logging;
namespace FunctionAppOrchestration
{
public static class Function1
{
[Function(nameof(Function1))]
public static async Task<List<string>> RunOrchestrator(
[OrchestrationTrigger] TaskOrchestrationContext context)
{
ILogger logger = context.CreateReplaySafeLogger(nameof(Function1));
logger.LogInformation("Saying hello.");
var outputs = new List<string>();
// Replace name and input with values relevant for your Durable Functions Activity
outputs.Add(await context.CallActivityAsync<string>(nameof(SayHello), "Tokyo"));
outputs.Add(await context.CallActivityAsync<string>(nameof(SayHello), "Seattle"));
outputs.Add(await context.CallActivityAsync<string>(nameof(SayHello), "London"));
// returns ["Hello Tokyo!", "Hello Seattle!", "Hello London!"]
return outputs;
}
[Function(nameof(SayHello))]
public static string SayHello([ActivityTrigger] string name, FunctionContext executionContext)
{
ILogger logger = executionContext.GetLogger("SayHello");
logger.LogInformation("Saying hello to {name}.", name);
return $"Hello {name}!";
}
[Function("Function1_HttpStart")]
public static async Task<HttpResponseData> HttpStart(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequestData req,
[DurableClient] DurableTaskClient client,
FunctionContext executionContext)
{
ILogger logger = executionContext.GetLogger("Function1_HttpStart");
// Function input comes from the request content.
string instanceId = await client.ScheduleNewOrchestrationInstanceAsync(
nameof(Function1));
logger.LogInformation("Started orchestration with ID = '{instanceId}'.", instanceId);
// Returns an HTTP 202 response with an instance management payload.
// See https://learn.microsoft.com/azure/azure-functions/durable/durable-functions-http-api#start-orchestration
var resp = await client.CreateCheckStatusResponseAsync(req, instanceId);
return resp;
}
}
} This project type seems to have no dependency to Webjobs (https://learn.microsoft.com/en-us/azure/app-service/webjobs-create?tabs=windowscode) as I see it! I can be wrong :-) My understanding is that Azure Functions (https://learn.microsoft.com/en-us/azure/azure-functions/functions-overview?pivots=programming-language-csharp) probably have a different way of work compared to Webjobs? |
Beta Was this translation helpful? Give feedback.
-
Sorry my bad! "To inject DfMon into your .NET Isolated + MSSQL project you can just copy-paste code from here." works well. |
Beta Was this translation helpful? Give feedback.
-
Get these lines in my log. [2024-08-30T07:18:53.439Z] Executed 'Functions.DfmAboutFunction' (Succeeded, Id=ac289c45-954b-4255-9bdb-8d824fc3163e, Duration=69ms) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
First; Thanks for building a tool for Durable Functions :)
Do the DurableFunctionsMonitor have support for Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer?
Beta Was this translation helpful? Give feedback.
All reactions