Welcome to the Azure Durable Functions Sample repository! This repository contains sample code demonstrating the use of Azure Durable Functions for notifying the support team when any issues arise in the connected system.
This project implements a notification workflow using Azure Durable Functions. It includes two orchestrators and several activity functions to handle the complete notification process efficiently.
-
NotifySupportOrchestrator
- Purpose: Main orchestrator responsible for the entire notification flow.
- Trigger: Activated by
NotifySupportHttpClient
when an alert is received from an external system. - Flow:
- Fetches support contacts using the
GetContactActivity
function. - Invokes the
SendNotificationOrchestrator
to notify the support contacts.
- Fetches support contacts using the
-
SendNotificationOrchestrator
- Purpose: Handles sending notifications to the specified support contact.
- Retries: Attempts to send the notification up to 2 additional times after a specified period if a response is not received.
- Flow:
- Sends a notification to
SendNotificationActivity.cs
and waits for a response through theCallbackHttpClient
. - If a response is received, it stops the workflow and returns the information to the main orchestrator.
- If no response is received within the specified period, it notifies the main orchestrator, which then retries the notification with the next contact.
- Sends a notification to
Contains the main orchestrator function that coordinates the entire support notification workflow.
Handles the logic for sending notifications to support contacts and managing retries.
Activity function responsible for fetching the list of support contacts.
Activity function responsible for sending notification to the contact.
HTTP client function that triggers the main orchestrator upon receiving an alert from the external system.
HTTP client function that handles responses from support contacts, notifying the orchestrator of the received responses.
- Clone the repository:
git clone https://github.com/gravity9-tech/azure-durable-functions-meetup-sample.git cd azure-durable-functions-meetup-sample
- Open the project in Visual Studio or VS Code.
- Ensure all necessary Azure Functions extensions are installed.
- Run the project locally using the Azure Functions Core Tools:
func start
- Publish the function app to your Azure subscription:
func azure functionapp publish <FunctionAppName>
- Trigger the Workflow: The
NotifySupportHttpClient
function should be invoked by the external system when an alert is generated. - Monitor the Workflow: Use status url that was returned from the HTTP request to monitor the current status of the execution.
- Handle Responses: The
CallbackHttpClient
function processes responses from support contacts and updates the orchestrator accordingly.
Thank you for exploring Azure Durable Functions with us at the Gravity9 Meetup! If you have any questions or need further assistance, feel free to reach out.