Automated email when connection to source fails in Azure - 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 .

Related

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 Data Factory V2 - Sending Custom Email (without Logic Apps)

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]

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

Azure LogicAPP to Receive data from SAP Message Server (Preview)

Does anybody know how to retrieve data from SAP module using SAP Message Server (Preview) in LogicApp.
I have connected to on premise gateway but not sure how do I call the SAP module from LogicApp. I have tried to google blogs or article for using SAP Message Server (Preview) but couldn't find anything that could explain how can you connect SAP Module with your logic app on azure.
Thanks
Hi Bhavesh we are mainly using two way to connect Logic app to SAP
1) BABI
2) IDOC
Does anybody know how to retrieve data from SAP module using SAP Message Server (Preview) in LogicApp.
You may get the answer from the Azure official document. The following is the snippet from the document.
1.Add the Request/Response trigger, and then select New step.
2.Select Add an action, and then select the SAP connector by typing SAP in the search field:
3.Select SAP Application Server or SAP Message Server, based on your SAP setup. If you don't have an existing connection, you are prompted to create one.
4.Enter a name for your SAP connection
5.The different SAP options are now available. To find your IDOC category, select from the list. Or manually type in the path, and select the HTTP response in the body field:
6.Add the action for creating an HTTP Response. The response message should be from the SAP output
7.Save your logic app. Test it by sending an IDOC through the HTTP trigger URL. After the IDOC is sent, wait for the response from the logic app:
Note:
Current limitations:
Your logic app times out if all steps required for the response don't finish within the request timeout limit. In this scenario, requests might get blocked.
The file picker does not display all the available fields. In this scenario, you can manually add paths.

Resources