azure-functionsazure-webjobsazure-webjobssdkazure-durable-functions

Get events when an Azure Durable Function changes status


I want to monitor a running instance of an Azure Durable Orchestrator Function for changes (like when it completes, fails etc)

I know that I can poll the status API for changes, but i was wondering if there were any push-based functionality. I've looked into the source code but I can't seem to find any clues to extension points, interfaces etc that enables this.

Any ideas on how to achieve this?

Thanks!


Solution

  • Right now, publishing orchestration lifecycle events (such as created, completed, and failed) is limited to a custom Azure Event Grid Topic. This feature is currently in preview. Refer Durable Functions publishing to Azure Event Grid (preview).

    Durable Functions 2.x

    Add a notifications section to the durableTask property of the file, replacing <topic_name> with the name you chose. If the durableTask or extensions properties don't exist, create them like this example:

    {
      "version": "2.0",
      "extensions": {
        "durableTask": {
          "notifications": {
            "eventGrid": {
              "topicEndpoint": "https://<topic_name>.westus2-1.eventgrid.azure.net/api/events",
              "keySettingName": "EventGridKey"
            }
          }
        }
      }
    }
    

    Event Schema

    The following list explains the lifecycle events schema: