Azure Data Factory V2 - Sending Custom Email (without Logic Apps) - azure

I know that you can send email alerts for a Data Factory pipeline using Azure Monitoring AND that you can send custom emails using a Logic App and the http request trigger. Is there another simpler way to send an email to alert someone when a pipeline fails with the details of the error message included?

Yes you can, but this method would be complex than creating a logic app or configuring default email alerts
You can create a stored procedure in a SQL DB which would send an email
Add the stored procedure in Failure output section of your ADF activity
Any reason for skipping traditional method of sending email from Azure? Maybe I can help
Thanks!

There are multiple ways of sending emails but I would suggest to use logic apps as the easiest.
You can even run a C# code using custom activity in ADF but it has to be build and deployed to a container and then you have to point this util/exe file in Data Factory -> [https://learn.microsoft.com/en-us/azure/data-factory/transform-data-using-custom-activity][1]

Related

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 .

Azure Logic Apps - When a new email arrives workflow does not trigger

I'm trying to create an Azure Logic App Workflow to extract attachments when email arrives.
I have a workflow on my account to generate Logic App design.
This workflow is directly paste in our azuredeploy.json file to be deploy with our pipeline on the Azure Logic App main account.
This workflow works perfectly on my app but not in the deployed app. In the deployed app, when I send an email to test the workflow, it does not trigger the event like it does in my account.
It seems that our issue came from the office365 email that we specially created (which is different from ours) the be used to get email with attachments.
And now I just tried with the trigger "When a new email arrives in a shared mailbox" and it work exactly as expected. But it's not a shared mailbox !
Has anyone encountered this issue before?
I believe you have created your connection to Office 365 (Outlook) using your own account, which would explain why it works for you, and the Shared Mailbox (which only requires one having access to it).
However, your scenario requires the "delegated permissions" model, for which Graph API is better suited.
May I kindly suggest you read https://learn.microsoft.com/en-us/azure/connectors/connectors-native-http

Send azure monitor alert to slack not working

I am sure this has been asked many times but am unable to find relevant answer. Is there any way to send Azure monitor alerts to slack via Logic apps or some other way. I have found this template - https://github.com/Azure/azure-quickstart-templates/tree/master/demos/alert-to-slack-with-logic-app and integrated it into my azure system but it is not working.
Have tried some work around mentioned at - https://github.com/Azure/azure-quickstart-templates/issues/3319 but all in vain
Direct Webhook from action group using slack incoming webhook is not supported , as azure sends alert using its own schema.
Any input is highly appreciated ...
Azure Logic Apps is definitely an option, but if you are not needing complicated workflows, just send the alert directly from Azure Monitor to a Slack channel. You can do this by generating a unique email for the Slack channel and using that email in your Azure Monitor alert action group settings. Another option would be to send the alert to your company alert email inbox and have it automatically forwarded to that Slack channel email address. With this approach you completely remove the dependency and complexity of Azure Logic Apps.
https://slack.com/help/articles/206819278-Send-emails-to-Slack#h_01F4WDZG8RTCTNAMR4KJ7D419V

connectors to applications 'azureeventgrid' is not compatible with the Gmail

As part of microsoft integration service. I'm using an azure logic app that should send message to my GMAIL address each time an event is happening in a VM under a specified resource group.
Scenario applied is :
create RG + VM
create blank logic app
add event grid trigger
add condition ......
send email notificiations
(as of the link : article )
But Logic app designer denied to save as I receive the following message :
Failed to save logic app XXXXla01. The operation on workflow 'XXXXla01' cannot be completed because it contains connectors to applications 'azureeventgrid' which are not compatible with the Gmail connector.
When workraround, I find this article that stated some google policies update.
I'm looking now for an alternative to this issue, where I can still use an azure resource that send notifications to my GMAIL address everytime an event is happening to my VM.
Issue with Gmail API was resolved with the procedure : article

Azure Logic App - Simple Email Template for JSON Request Body

I've got a simple Azure Logic App, which receives and emails out JSON data in a very basic HTML table format (created with a convertToTableAction).
Does anyone know of a way to instead send this out using an email template?
I've got a SendGrid account set up with my Azure subscription, but there doesn't seem to be any way to specify a template id with the Send email (v2) action in Logic apps.
I can't quite see how I'd edit the Logic App code to use the only SendGrid api that seems to support sending templates V3 either. (It is my first Logic app though, so I could well be missing a trick)
Really, any advice on how to send out a templated email would be appreciated.
As you mentioned that the logic app integrate the Sendgrid(V2) currently. You could give your feedback to Azure team.
If azure function is acceptable, you could add and run custom code for logic apps through Azure Functions
there is two way to do it ..
1) Using SendGrid Connector :
You need to create one azure function or web API pass request as your JSON outout string and replace with html content and get html in response
Pass html response in body of the send email action of SendGrid Connector
Details of SendGrid Connector
Please refer this link for Json data replaced to html
my explanation is very short but if you don't understand then i will help you in details

Resources