Why Is API Management Not Triggering Logic App? - azure

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~

Related

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

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.

How to get a callback when an Azure Marketplace Managed Application is installed from marketplace

The Microsoft documentation states:
Provide a notification endpoint URL: In the Notification Endpoint URL
box, provide an HTTPS Webhook endpoint to receive notifications about
all CRUD operations on managed application instances of this plan
version.
I created a simple Logic App and copied the HTTP endpoint into my MPN App Plan under the
It looks like this and has the sig at the end:
https://prod-08.australiaeast.logic.azure.com:443/workflows/fe287d1b9a8c48619a1b44765dad6dc7/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=C9JYfNPjvq-efsLwW66A4K4zTgx6qxGT1oH0RZZRsI0
To test it I hit it with PostMan and confirm that it is getting an HTTP200 as per the MS Docs.
I publish the app to the marketplace:
(you can see the app live here - https://azuremarketplace.microsoft.com/en-us/marketplace/apps/data-drivenai1581501556049.cloudmonitor-analytics-engine)
However - the endpoint never gets called at all. I can see in the logs that no attempt (failed or past) has been made to call it.
I raised a Microsoft Support Ticket and asked a Technical Specialist, however no one can tell me how to debug it or why it is not calling back on installs or failed installs.
Has anyone seen this working?
Update
I found out that each PLAN has a GUID that is automatically used for deployment. Mine is "pid-34881ea9-xxxx--xxxx-xxxx-2cf731e06ef7-partnercenter" - should I be putting this on the callback notification URL as sig=ThisGUID?
In the example for Managed apps with notifications, it shows that managed applications will send a post to https://{your_endpoint_URI}/resource. Can you try adding /resource to your listener and see if it triggers your logic app? I believe that should fix this.

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

Video Indexer Logic App InvalidTemplate Error

I have created a Video Indexer with Logic Apps connector by following this Microsoft documentations bud in the Get Video Index I get this InvalidTemplate Error.
For this problem, it was caused by missing query when you request the url of logic app trigger. The expression triggerOutputs()['queries']['id'] mentioned in the document is used to get the id parameter in query of request. If you don't provide the id when you request the logic app trigger url, it will show this error message.
To solve this issue, you need to request the logic app trigger url with id in its query. Just append &id=xxx to the url and request it in postman or browser.
https://prod-21.eastasia.logic.azure.com:443/workflows/6bfa4xxxxxxxx&sig=0ziso_T8xxxxxxxVNAidP6tiC22M_hhQH0&id=xxx
By the way, before request the url with &id=xxx, you need to set the trigger Method as Get.

How to Redirect to an MVC web app controller from azure logic app

I am using azure logic app which consumes a web API via a connector and based on some condition, I want to send some data to a controller of my web application.
any ideas how this can be done ?
You can use an HTTP action in your Logic App to send data to a specific endpoint:
As you can see you're also able to add dynamic content to the body you would like to send.
For more information, check Get started with the HTTP action.
I would say don't over think this too much. It's a pretty basic process.
Get the response form your API.
Extract the values you need to test for the condition
Test the values in a Condition Action
Call the end points based on each Condition.

Resources