Azure Data Factory Pipeline Alert Email Send Everytime - azure

I would like to send an email via an alert once an Azure Data Factory Pipeline has either finished successfully or failed. This is fairly simple to setup and I get the email once! However after the first time the email is sent it never sends again.
I understand that this is because the alert is in a fired state and will not send again unless this is changed. There is no way to change the state of the alert so the alert will never be triggered again.
Is there anyway to make it so the notification sends an email everytime the pipeline runs?

Your understanding is correct , that once an alert is fired ( for what ever reason ) it needs to be deactivated and then only the other one can be fired again . My understanding is the alerts are configured for "not the happy path" and so the logic makes sense .
As it appears that just want to an email alert when your pipeline is executed . I suggest to use a logic App to do that . You can execute this as the last activity in the pipeline and call the logic app from the pipeline . Configuring its is very easy .

Related

Can we invoke (run) azure pipeline on receiving email

We are looking for the possibility of a situation
Where our vendor sends us email on the update and upon receiving that email we want to run our azure pipeline or release
Automatically
So is it possible to do that
Our mail server is office Outlook and pipelines are in azure dev ops
Our intention is if we received update to email then we want to run pipeline
Note: we can even maintain specific email id to get update notifications and set it like once we receive that email olwe should invoke pipeline
Please help me if we can do it or not
If yes any info about this is very helpful

Automated email when connection to source fails in Azure

sorry if the question is too basic. I am very new to Azure and I want to receive automated email if a connection to for example a SQL server is not established. In that regard, I was wondering if there is anything like get meta data activity for linked services that could output true or false if a connection is is not established? given that there is such activity, I know how to to the rest of job. I would appreciate it if someone could help.
Thanks in advance
I have searched about it and tried to find the option of linkedservice instead of dataset in some activities settings but have not figured it out yet.
You can make use of Logic App in Azure with your Azure Data factory to receive an email when there’s an error.
I created a Logic app resource with the connectors as mentioned below:-
I created an ADF pipeline and sent an email on my Outlook when I received an error like below:-
My copy data activity failed like below:-
Now, I’ll add one control flow on Web Activity that will trigger our Logic app to send an Email alert.
Added my Logic app URL in the Web activity URL and content-type set to application/json :
Added the dynamic content in the body to get the Error message and details in the email:-
As the Copy activity failed, I got an email alert like below:-
Reference:-
https://learn.microsoft.com/en-us/azure/data-factory/how-to-send-email
How about getting an text message with email ? :)
You can create monitoring on a pipeline and on failure it will send an email and also a text message . Please read more on the same here https://azure.microsoft.com/en-us/blog/create-alerts-to-proactively-monitor-your-data-factory-pipelines/.
Now for the pipeline , you can add a Lookup actvity and add a simple query like
"Select top 1 from someTable"
When the connection to the SQL will fail , the activity will fail and also the pipeline . You should get and email and text for the failures .

How to find the specific run for a logic app failure alert?

When an alert is sent to ICM or Azure Monitor it sends the time of creation, among other somewhat useless information. Since alerts can be delayed by 5 minutes or so, creationTime for the alert will be off and this causes issues when a Logic App runs more than once within a 5-minute span.
Is there a way to see which run triggered the alert? Is there was a way to attach the associated runId and send it with the alert payload?
You can get run id of logic app with payload using compose action and dynamic expressions. I have reproduced issue from my side.
Below are steps I followed.
Created an alert and configured action group in conditions tab.
Created logic app to send mail with payload as shown below,
In Initialize variable, taking the payload in a variable.
In compose action added runid with dynamic expressions as workflow().run.name
In send email action, outputs of compose action.
When condition satisfied logic app ran successfully, and mail sent successfully
Reference for workflow expression

get email ID of person debuging azure data factory pipeline

I have a production and a development environment in azure data factory. I have developed the pipeline such that when the pipeline fails, we get an email notification. However the issue is if someone tests a pipeline in development and it fails we still get error email and this is bugging a lot of people as no one wants to see email of someone else's error run.
Is there a way to implement the pipeline in such a way that, if a pipeline fails in production everyone should receive an email but if a pipeline fails in development, only the developer should get the email? I cannot seem to find any system assigned variable or something like User().email just like we have in powerapps.
Please see: We cannot have a parameter in pipeline like email: <>. I need a way to get email id of the person using the pipeline dynamically.
You can invoke a REST API to activity logs and get the event initiated by - which has user information of who triggered the pipeline.
Sample Request
https://management.azure.com/subscriptions/<SUBSCRIPTION>/providers/Microsoft.Insights/eventtypes/management/values?api-version=2015-04-01&$filter=eventTimestamp ge '<CurrenTime - 5 mins>' and eventTimestamp le '<CURRENT TIME + 5 mins>' and resourceUri eq /subscriptions/<SUBSCRIPTION>/resourceGroups/<RESOURCEGROUP>/providers/Microsoft.DataFactory/factories/<DATAFACTORYNAME>'
Refer this link for more information

Azure Alert Action connected to Logic App Webhook firing twice every time an alert is triggered

I'm having this strange issue with Azure Monitor where an alert action that is pointing to a webhook is firing twice every time it gets triggered. (I'm assuming it isn't the alert that is firing twice necessarily but the Logic App that is receiving it that is firing twice for some reason)
Action Alert Setup
Action Timestamp
Related Logic App Sample Run History
Basic Logic App Setup
Is this a common problem with hooking up action alerts to webhooks or logic apps or is there some setting I need to be aware of to prevent this?
Please check the monitor condition of your second alert message. Probably it is sending notification with monitor condition resolved. For now it is not possible to disable triggering action group with resolved monitor condition but you can modify your webhook endpoint to ignore resolved state. Please check this issue: https://feedback.azure.com/forums/267889-azure-monitor-log-analytics/suggestions/37167487-send-alerts-with-resolved-state-for-log-alert-rule

Resources