Pரதீப்
Pரதீப்

Reputation: 93724

Trigger an action when azure function is stopped c#

As the title states, is there a way to trigger an action when the function is manually stopped or restarted ?

Example, when the function is stopped I want to make an update in Azure table storage.

I searched quite a lot in google couldn't find anything meaningful, any pointer will be helpful.

Upvotes: 0

Views: 255

Answers (2)

Alex Gordon
Alex Gordon

Reputation: 60751

  1. create logic app
  2. add a recurrence action (on a specified interval)
  3. add an http request to the function
  4. add an if action to check for 503 unavailable from the function app
  5. add an action to update your table

Upvotes: 0

Pete Philters
Pete Philters

Reputation: 889

You can use an Azure Event Grid to achieve this. Event Grids utilise the central nervous system of Azure by being able to intercept logs from the Azure Monitor.

Follow this tutorial here to achieve exactly what you need to do however change the operation on the condition step to:

Microsoft.Web/sites/stop/action

In your logic app. You can then apply whatever logic you want to the true step in the Logic App

Upvotes: 1

Related Questions