DurableFunctionsMonitor/durablefunctionsmonitor.dot...
Eric Dugas 55e7874943
Update README.md to reflect currently supported .net version (#211)
Change link text from .net 7 to .net 8, as it is the currently referenced version in the doc that is referenced, and the current version of durablefunctionsmonitor.dotnetisolated (6.5) is indicated to support .net 8
2024-09-09 20:15:18 +02:00
..
Common #161, fixing server-directed auth for Isolated with ASP.Net Core Integration (#190) 2024-06-26 23:13:41 +02:00
Functions fixes for ASP.NET Core Integration 2024-05-10 18:48:59 +02:00
.gitignore
README.md Update README.md to reflect currently supported .net version (#211) 2024-09-09 20:15:18 +02:00
durablefunctionsmonitor.dotnetisolated.core.csproj v6.5 (#204) 2024-06-30 14:54:53 +02:00

README.md

DurableFunctionsMonitor.DotNetIsolated.Core

An incarnation of DurableFunctionsMonitor that can be "injected" into your .NET 8 Isolated Azure Function.

How to use

  • Install from NuGet:

    dotnet add package DurableFunctionsMonitor.DotNetIsolated
    
  • Initialize by calling .UseDurableFunctionMonitor() extension method during your Function's startup, like this:

    var host = new HostBuilder()
       .ConfigureFunctionsWorkerDefaults((hostBuilderContext, workerAppBuilder) => {
    
           workerAppBuilder.UseDurableFunctionsMonitor();
    
       })
       .Build();
    

    By default all settings are read from env variables (all the same config settings are supported), but those can be programmatically (re)configured like this:

    var host = new HostBuilder()
        .ConfigureFunctionsWorkerDefaults((hostBuilderContext, workerAppBuilder) => {
    
            workerAppBuilder.UseDurableFunctionsMonitor((settings, extensionPoints) => 
            {
                // Override DfMon's settings here, e.g.
                settings.Mode = DfmMode.ReadOnly;
                // ....
            });
    
        })
        .Build();
    

    By default DfMon's endpoint will appear at http://localhost:7071/my-api-route-prefix/durable-functions-monitor. To override that behavior (e.g. to have it served from the root) add a custom statics-serving function like this:

    namespace DurableFunctionsMonitor.DotNetIsolated
    {
        public class MyCustomDfMonEndpoint: ServeStatics
        {
            public MyCustomDfMonEndpoint(DfmSettings dfmSettings, DfmExtensionPoints extensionPoints, ILoggerFactory loggerFactory) : 
                base(dfmSettings, extensionPoints, loggerFactory)
            {
            }
    
            [Function(nameof(MyCustomDfMonEndpoint))]
            public Task<HttpResponseData> ServeDfMonStatics(
                [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "/{p1?}/{p2?}/{p3?}")] HttpRequestData req,
                string p1,
                string p2,
                string p3
            )
            {
                return this.DfmServeStaticsFunction(req, p1, p2, p3);
            }
        }
    }
    

Limitations

  • Multiple Storage connection strings are not supported, only the default one (AzureWebJobsStorage).
  • For non-default durability providers you'll need to provide custom routines for retrieving instance history etc. This should be done via extensionPoints parameter of .UseDurableFunctionsMonitor() configuration method. Code for MSSQL storage provider can be directly copied from here.