Chris Phillips
Chris Phillips

Reputation: 2124

How can I 'listen' for status changes on an azure durable function?

I have a web app where clients can press a button that calls a durable function. As long as that function is executing, a spinning wheel is animated. When the function finishes executing, I stop/hide the loading wheel, and show a green check-mark.

Currently, I'm just hitting the "statusQueryGetUri" returned by the durable function, on a regular interval, to see if the function is running/stopped.

Is there a way for me to 'listen' for changes in status so I'm not hitting that URL repeatedly?

Upvotes: 0

Views: 399

Answers (2)

Alex Gordon
Alex Gordon

Reputation: 60751

You can set up a timer-triggered logic app that will do this for you on a recurrent schedule.

Upvotes: 0

JayaChatterjee-MSFT
JayaChatterjee-MSFT

Reputation: 961

You may follow this link to configure the email/ any notification alert for your azure functions.

You may also check these links for step by step implementation :

http://www.mattruma.com/adventures-with-azure-functions-create-an-alert-from-app-insight-to-send-an-email-notification/

https://learn.microsoft.com/en-us/azure/azure-monitor/platform/alerts-log

While you create the alert rule you have an option to select condition:

enter image description here

There you get "Custom Log Search" as an option:

25951-image.png

You can configure the type of trigger or resource on which you want to perform this action while creating the action group: enter image description here

You can customize the rule according to your requirement. i.e. you can check for traces log for any execution or you may just check the status of the function. [ this is a reference ]

You may look into these documents for reference:

https://www.fourmoo.com/2020/02/19/how-to-configure-azure-function-app-notifications-for-errors/

http://www.mattruma.com/adventures-with-azure-functions-create-an-alert-from-app-insight-to-send-an-email-notification

Upvotes: 1

Related Questions