Video Indexer Logic App InvalidTemplate Error - azure

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.

Related

Azure ADF Web Activity Form data

I am using Web Activity to get the response from an API. The API takes a Csv file as its body parameter along with some string. I tried using this link How can i pass file as parameter in post request (Web Activity) Azure Data Factory? but could not succeed, I was getting the below error
The other help says to use logic apps for this , has anyone tried using web activity for posting form-data.

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.

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 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~

logic app check who has read a yammer post

I'm looking at the Logic Apps Yammer connector.
When we put a message on Yammer we want to find out who has read it. Is there a way to find a list of people in a Yammer group who have not read a Yammer message?
If it can't be done in Logic Apps, is there another way to do it?
As a workaround, I'm trying to do this on the basis of who has liked a message and have done this in Logic apps. It gives a message that the response is not in JSON format. Also, it gives me the number of likes rather than a list of people who have liked it.
This is what I put into the HTTP request
After our chat I tried this
and this
and got this error message.
"error": "invalid_request",
"error_description": "AADSTS900144: The request body must contain the following parameter: 'grant_type'.\r\nTrace ID: d41c78c7-afa5-405f-8f52-8b587ecf1a00\r\nCorrelation ID: 9ffd2247-78ca-4be2-8111-c17a95a830d6\r\nTimestamp: 2020-01-23 10:09:55Z",
"error_codes": [
900144
]
I also tried putting in my Azure directory id in place of tenant id. It failed with and without the directory id.
It seems there isn't an action in logic app Yammer connector which can get the list of users in a group who haven't read a message. And I checked all of the rest api in Yammer api document. Just find a rest api which can get the users in a group:
https://www.yammer.com/api/v1/users/in_group/:Group_Id.json
So I think neither yammer rest api nor logic app can not implement this requirement of get the list of users in a group who haven't read a message.
Update:
For your question about how to implement the workaround in logic app, as I don't have yammer app and account, so I can just provide some suggestions for your reference.
Since the yammer actions in logic app are very limited, so we can just use yammer Apis in logic according to HTTP action.
First we need to get access token from yammer, you can refer to this tutorial and refer to the C. App Authentication title in it. Put this post url in HTTP action in logic app and get the response body. Parse the response body and get the token property under the access_token property. Then we can use this token in the apis which we will call in the next HTTP actions.
Then, call this api in HTTP action(choose "Get" as the method) with the token which we got above to get the users who like the message, the url should be like this:
https://www.yammer.com/api/v1/users/liked_message/:Message_id.json?access_token=<<ACCESSTOKEN>>
Get the response body(and parse it in json type in array) from the api above and then call the other api in HTTP action(with access token) to get the users in one group. Also get the response body from it and parse it in json type and store in array.
After that, use two nested "For each" actions in logic app to loop the two array and compare them. Then we can get the result which you want.
Update 2:

Resources