Logic App failed but the web activity in ADF calling this logic app has success status - azure

I have a web activity within ADF pipeline which calls the Logic app to get a file from azure blob storage depending on some switch conditions and send email notification with the file as an attachment.
adf pipeline -> web activity -> logic app http trigger -> switch condition -> gets file content from azure blob storage if the condition is satisfied -> send email with file as attachment
I was testing this component for scenarios where the switch condition is satisfied and the file doesn't exists. The logic app as expected fails with the resource not found error, but the web activity completes successfully.
Has anyone faced similar situation, any pointers would be useful.

Your http triggered logic app is by default asynchronous. This means when you call the API/logic app, you will get a 201 response code indicating that the Logic app has received the request but does not indicate if it has finished processing the request. This is what is happening in your case. To confirm, you can check if the response code is 201. The behavior is similar when you attempt to execute the logic app via a request from Postman.
To fix this, you will need to make the logic app synchronous. To do this, you will need to add a success response step at the end of the logic app to respond with a 200. You will need to add additional response steps to respond with a failure response code wherever your logic app may fail. You can refer how to set your logic app using this LINK.

Related

How to store and get http form data in Azure Insights for Azure Function app

We have Azure Function app (v.4) with post api calls to some external rest resource. I can see occasional failures in Azure monitoring (Azure Insights), but everything I was able to collect in Logs is external api endpoint url (Path like https://... when you open dependencies) with the request get parameters. In order to troubelshoot the failure I need to collect Form data as well for post requests. I wonder how easy it would be, like as easy as setting some flag in azure configuration or modifying app and writing tracing logs explicitly.
The App Insights -> Transaction Search in the portal will show the requests and trace messages but it will only indicate that the function made a HTTP POST call, the response code and duration of that call, it will not show the payload details, so the function app explicitly need to log those details as TRACE info using ILogger instance that is injected to the function.

Response from `InvokeRESTAPI` on my Azure pipeline

My InvokeRESTAPI displays the following if executed:
I can see a Response field printed that is empty.
Can I somehow use this to get a value back from the API reply and use it to call another template with it?
On the task itself I am using this parameter:
successCriteria: eq(root["status"], "successful")
So I would assume that if there is some custom success criterion then I would be able to use a value from the response in order to define it.
Based on your screenshot, you are using the API to post the json content to Azure Logic App workflow.
So you need to add the Response Action in Azure Logic App to add response content to the work flow.
Here are the steps:
In Logic App:
Then when you run the API in Invoke Rest API task, it will show the customer response.
For more detailed info, you could refer to this doc: Construct the response

Why doesn't Logic Apps Schedular work with a WHEN HTTP REQUEST IS RECEIVED?

In Azure Logic Apps, if we create a trigger (when HTTP Request is received) - still why can't I add a schedular to execute that trigger? In Logic apps, it doesn't allow that.
"When a HTTP request is received" trigger is used to request the url to trigger the logic app, but not as a "schedule" triggered every a while. We can just trigger the logic app by request the url manually (such as in postman, shown as below screenshot).
If you want a workaround for that, create 2 logicApps:
first with HttpTrigger
second with schedule, and here just add Http request to your first logicApp
doc: https://learn.microsoft.com/pl-pl/azure/connectors/connectors-native-recurrence

Why Is API Management Not Triggering Logic App?

I have a logic app that I'm trying to put behind API Management and it's not triggering at all. For testing purposes I created a new logic app with these steps and I'm running into the same issue.
I'm adding the API by selecting Logic App in the APIM portal, setting a suffix of sandbox and adding the unlimited product. The original url for the logic app is https://{baseurl}.logic.azure.com/workflows/{workflow}/triggers/manual/paths/invoke/address/{postalCode}?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig={sig} and the url I'm hitting for the api management endpoint is https://{apim-name}.azure-api.net/sandbox/manual/paths/invoke/address/{postalCode}
The result when I hit the logic app directly is Postal Code: {postalCode} when I hit the api management endpoint it just returns an empty result with a 200 HTTP Code. I can look at the logic app and see it's not getting triggered.
Has any else run into this? Any help would be appreciated.
I don't know why you got 202 with empty result, but I test it success. I got the Postal Code: {postalCode} after request the APIM endpoint(both request in the APIM test and request it in postman). Here I provide my steps for your reference.
1. I create a logic app shown as below:
2. Then I create APIM and configure the logic app url in it.
3. Click the "Send" button in APIM test, get the response shown as below:
4. When request the APIM request url in postman, it also get result success.
Hope it helps~

Getting notification when HTTP Fails (Azure Logic App)

I'm new to Azure, i searched but didn't find something reliable for me.I have an azure app which is sending some HTTP requests to my API. Is there any chance to get an email notification if the HTTP request fails ?
You could try to create an alert rule for your logic app, navigate to the logic app in the portal -> Alerts -> New alert rule. Specify the parameters, action group. You need to create a new action group first, use the Action Type with Email/SMS/Push/Voice, set the emails address, etc.
For more details, you could refer to this link.
you can take advantage of exceptional handling technique provided by the azure logic app
Add a trigger after the HTTP call as you want to send email add send email action
Click on the setting top right corner of the action
Click on configure run after
Select is failed or skipped
So this action will only if the previous action is failed

Resources