Automatically link newly created logic apps to an existing alert rule - azure

I have created an Alert action group which will simply call a "error" logic app when the conditions are met. And I have set up an event grid which will be called whenever an logic app gets created for the first time.
Now the challenge is that I want to somehow automatically link this newly created logic app to the action group.
I have searched for way to do this but had no luck, anyone knows if this is possible?

One way of updating an action group would be by using the management API, see the docs.
However, you might want to think about this a bit differently.
How are you going to deploy everything?
Assuming you're not going to be doing this manually, you will be using ARM-/Bicep-files. So, you could include the configuration of an action group in these deployment files.
Meaning, when you initially deploy the Logic App, it will immediately be added to an action group, allowing it to trigger the required alerts. Next to that, it also allows you to create the event subscriptions in your Azure Event Grid topic.
This way you avoid missing the first alert because the action group wasn't updated before the first run of the Logic App.
The template to create an action group can be found here.
The template to create an event grid subscription can be found here.

Related

Azure automatically edit resource after deployment

I am trying to create an automation with an event grid on a subscription so that whenever a resource is deployed it will send the event to a webhook that belongs to a runbook that adds a tag to the resource.
(resource deployed -> event grid -> runbooks webhook -> add tag)
However, when I add the tag it triggers a similar event which triggers the event grid again and a cycle begins. The event grid only allow write/action success type of event and there is no way of filtering only the creation events from the other event created by editing the resource.
I want to know if there's a workaround or maybe an alternative to using automation (I don't want to use a modify policy because I want to change other fields in the future not just change tags)
Thanks
You can use Azure Policy for that although you say you don't want. With a custom Azure Policy, you can modify the different properties of a resource.
Another advantage is that Azure Policy is free whereas you will pay for Automation Account.
On the other hand, for your current situation, I guess the Event Grid is triggered even when the resource is modified. So you need to modify that in order to avoid the loop.

How to add HTTP trigger in Azure Logic Apps

I want add a functionality in my ADF pipeline which will send me email notification in case of failure. On searching the internet, I came to know that Azure Logic Apps helps with this. I am trying to follow below link to achieve this.
https://microsoft-bitools.blogspot.com/2018/03/add-email-notification-in-azure-data.html
I have tried searching up many tutorials, guides and the official docs as well. However, all of them have some templates already there in the Logic Apps Designer. I cannot find the templates and the 'When a HTTP request is received' trigger is also not available in the drop-down.
Please let me know how to proceed.
EDIT :
If you start with a blank Logic App, search for 'HTTP' or 'Request' and select Request.
On the next screen under triggers, select "When a HTTP request is received" and you should be good to go.
EDIT:
It looks like you created a Standard Logic App, which works in a slightly different way. For instance it can contain multiple workflows, which means you create workflows yourself. In the Consumption model, there's one workflow withing a Logic App, so you can open up the editor for that one directly. If there's no explicit reason for you to use Standard, a Consumption Logic App will be easier to work with.
If you really need a Standard Logic App, go to 'Workflows' and create a new workflow:
Then click the newly created workflow to edit it, go to 'Designer' and search for 'HTTP' to add an HTTP trigger:
Here's some information on the Consumption model for Logic Apps:
Resource type
Benefits
Resource sharing and usage
Limits management
Logic App (Consumption) Host environment: Multi-tenant Azure Logic Apps
- Easiest to get started - Pay-for-what-you-use - Fully managed
A single logic app can have only one workflow. Logic apps created by customers across multiple tenants share the same processing (compute), storage, network, and so on.
Azure Logic Apps manages the default values for these limits, but you can change some of these values, if that option exists for a specific limit.
See Resource type and host environment differences for a comparison with the other hosting options.
I was able to solve this. I wasn't able to view a few functionalities because of another error : Functions runtime error Microsoft.WindowsAzure.Storage: Value cannot be null. (Parameter 'connectionString').
AzureWebJobsStorage App Setting was missing which caused the error. I added that and now I can see the triggers and other stuff.
Thanks #rickvdbosch

Trigger Azure Action Group from a Logic App

I have a Logic App running every minute that checks the time that data was last received in a table. If it has been enough time since the data was updated I want to receive an alert. I really like the Action Groups used by the Alerts in Azure. They are clean and have lots of options like email, SMS, and Phone. How can I trigger an Action Group from my Logic App?
I know I can recreate the email, SMS, and Phone connections in the Logic App, but then it's harder to maintain. I'm already using the same Action Group for other Alerts. It would be easier to maintain if I could reuse this Action Group.
There is ton online about triggering a Logic App from an Action Group. This is NOT what I'm trying to do. I want the reverse. I want to trigger an Action Group from a Logic App.
How can I trigger an Action Group from my Logic App?
Currently as per the documentation We can trigger a particular logic app using the action group but there is no way to trigger a particular action group using logic app.
It would be easier to maintain if I could reuse this Action Group.
Yes, you can use same action group in multiple alert mechanisms.
Would suggest you to raise a feature request using this azure support link.
You should be able to send data to a custom log in Log Analytics from your Logic App using Azure Log Analytics Data Collector.
Then you can use a Log Analytics query to evaluate resources logs every set frequency, and fire an alert based on the results. Rules can trigger one or more actions using Action Groups. - see Create, view, and manage log alerts using Azure Monitor.

Azure Logic App "When a work item is updated" trigger (Azure DevOps)

I'm trying to create an Azure logic app "when a work item is updated'. In the design, I'm not able to get the previous value of the properties and I'm not able to set a specific property depends on a condition.
As example cases:
1. I want to react when a work item changes its state depends on the previous state.
2. I want to see if the user adds completed work into the work item.

Trigger Azure logic app on resource creation

I'm working on an Azure Logic app that should trigger when a new resource is created.
However, if I trigger the app based on a webhook using monitor alerts or an event subscription, I run into the problem of each creation event will have 2 identical events with all the output being identical which means I can't filter it out and therefore triggers the logic app twice.
If there a different route around to just get the app to trigger once?
I believe the multiple events are because the event type for both create or update is the same as documented.
One way to workaround this would be to keep track of resourceIds touched by your Logic App, OR add a tag to your resource which signals that it has been touched. This way you wouldn't need an extra store for this metadata.

Resources