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:
id
: Unique identifier for the Event Grid event.
subject
: Path to the event subject. durable/orchestrator/{orchestrationRuntimeStatus}
. {orchestrationRuntimeStatus}
will be Running
, Completed
, Failed
, and Terminated
.
data
: Durable Functions Specific Parameters.
hubName
: TaskHub name.
functionName
: Orchestrator function name.
instanceId
: Durable Functions instanceId.
reason
: Additional data associated with the tracking event. For more information, see Diagnostics in Durable Functions (Azure Functions)
runtimeStatus
: Orchestration Runtime Status. Running, Completed, Failed, Canceled.
eventType
: "orchestratorEvent"
eventTime
: Event time (UTC).
dataVersion
: Version of the lifecycle event schema.
metadataVersion
: Version of the metadata.
topic
: Event grid topic resource.