0

I'm trying to figure out a way to generate a notification of some sort when a new Azure Function App gets deployed. I'm developing in Python and using consumption plan.

Is it possible to achieve what I need?

Alternatively, is it possible to run (even locally) a task before/after a new deployment via VS code happens?

Thanks in advance

guidout
  • 322
  • 1
  • 4
  • 13

1 Answers1

0

You can try use Log Analytics workspace and configure an alert email when the function app is published.

First, create a Log Analytics workspace, then in azure portal -> nav to the Log Analytics workspace -> Logs, and write the following query(Note: the caller is your azure account(email address)):

AzureActivity
| where Caller == "xxx@xxx.com" 
| where OperationName == "Create Deployment" 
| where OperationNameValue == "Microsoft.Resources/deployments/write" 

Then click "New alert rule" to create the rule.

The screenshot as below:

enter image description here

Then in the "create rule" page, click Condition to configure details. The screenshot as below and please configure the values as per your need:

enter image description here

After you configured the rule, when you publish a new function app, you will receive an alert email(if you configured the alert sent to an email).

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
  • thank you for the reply. I could make this work, but it's probably a bit clunky. I think my posted my question in a bad way. I'm trying to do some sort of versioning control since CI/CD for python/linux apps is not supported yet. Basically I'd need to get latest deployment date. I posted another question https://stackoverflow.com/questions/60189439/how-to-get-latest-deployment-date-of-a-function-app-maybe-via-the-azure-rest-ap – guidout Feb 12 '20 at 13:31
  • @guidout since it can work(but a bit clunky), could you please accept it as answer, for closing this issue? Thanks. – Ivan Glasenberg Feb 26 '20 at 02:07
  • @Ivan Yang it is not about collecting points/closing issue, the community is all about helping others, he is trying to solve a completely different issue, like a listener to trigger a set of other apparently custom activities. – theK Nov 11 '20 at 09:51