SFTP trigger that isn't triggering in Logic APP - azure

I have also an SFTP trigger that isn't triggering. I added a file to the SFTP folder and nothing happens. I think I had done this successfully in the past. I have it set to to check every 3 minutes.
Edit: I found that if I clicked on the "skipped" entry that I could see the input and output links. I noticed X-Frame-Options is deny. can anyone help me to solve this issue
output is
{
"statusCode": 202,
"headers": {
"Pragma": "no-cache",
"Retry-After": "15",
"x-ms-request-id": "1eb3db25-ce9d-4387-91fc-612e035017f7",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "DENY",
"Timing-Allow-Origin": "*",
"x-ms-apihub-cached-response": "true",
"Cache-Control": "no-store, no-cache",
"Date": "Thu, 03 Oct 2019 16:23:08 GMT",
"Location": "https://logic-apis-eastus2.azure-apim.net/apim/sftp/ddd3328a306446e4b5d438eb72ca1fba/datasets/default/triggers/batch/onupdatedfile?folderId=L2N5Z2RyaXZlL2MvVXBsb2FkRW5jb3VudGVyc0ZpbGU%3d&maxFileCount=1&triggerstate=eyJGaWxlSWQiOiIiLCJTdGF0dXMiOjEsIldpbmRvd1N0YXJ0VGltZSI6IjIwMTktMTAtMDNUMTY6MjI6MTZaIiwiV2luZG93RW5kVGltZSI6IjIwMTktMTAtMDNUMTY6MjI6MTZaIiwiTGFzdFByb2Nlc3NlZEZpbGVUaW1lIjoiMjAxOS0xMC0wM1QxNjoyMjowNy4wMDAwMDAxWiIsIkxhc3RDb25mbGljdFRpbWUiOiIyMDE5LTEwLTAzVDE2OjIyOjE5LjU4Mzg0NDNaIn0%3d",
"Set-Cookie": "ARRAffinity=a703f806325944e1ff92f5b6964fbc06b4fdf5647d48c76a29966c392ea989b9;Path=/;HttpOnly;Domain=sftp-eus2.azconn-eus2.p.azurewebsites.net",
"Content-Length": "0",
"Expires": "-1"
}
}

There could be multiple reasons of this issue as mentioned below:
1) Check your Logic App is enabled or not.
2) The SFTP connector handles only files that are 50 MB or smaller and doesn't support message chunking.
3) Do you have the correct SFTP folder specified in your SFTP connector? Are you uploading your files to the same folder?

Related

Call SharePoint Rest API from Azure Data Factory Pipeline Web

I am trying to use Azure Data Factory to call the SharePoint Rest API to access sharepoint list data. I need to use the rest api because the SharePoint list has some complex data types (multi-select lookups).
In my pipleline I have 2 Web activities, one (called GetAToken) to get an access token and one (called GetListData) to get the data using the access token.
The GetAToken web activity does a post to https://accounts.accesscontrol.windows.net/ee780cdf-8eab-4e6f-a740-c31a2aede2c0/tokens/OAuth/2
with the body:
grant_type=client_credentials&client_id=016dfe90-1b12-4938-8a9a-dee02a43d013#ee780cdf-8eab-4e6f-a740-c31a2aede2c0&client_secret={mysecrethere}&resource=00000003-0000-0ff1-ce00-000000000000/russellwgove.sharepoint.com.sharepoint.com#ee780cdf-8eab-4e6f-a740-c31a2aede2c0
When I debug, This runs successfully and returns this object containing the token:
{
"token_type": "Bearer",
"expires_in": "86399",
"not_before": "1667487425",
"expires_on": "1667574125",
"resource": "00000003-0000-0ff1-ce00-000000000000/russellwgove.sharepoint.com.sharepoint.com#ee780cdf-8eab-4e6f-a740-c31a2aede2c0",
"access_token": "{the token is here}",
"ADFWebActivityResponseHeaders": {
"Pragma": "no-cache",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Content-Type-Options": "nosniff",
"x-ms-request-id": "32926e95-5588-42ec-a8b3-349fef942a00",
"x-ms-ests-server": "2.1.14059.10 - EUS ProdSlices",
"X-XSS-Protection": "0",
"Cache-Control": "no-store, no-cache",
"P3P": "CP="DSP CUR OTPi IND OTRi ONL FIN"",
"Set-Cookie": "fpc=AgaNWKRvGG9IkIzP4suqH9H9VI5sAQAAAO3O9doOAAAA; expires=Sat, 03-Dec-2022 15:02:05 GMT; path=/; secure; HttpOnly; SameSite=None;esctx=AQABAAAAAAD--DLA3VO7QrddgJg7Wevrrm262sBqfXG85d6ros_Ik0DCezx_KFOnktHyOEHyz8OREffRB2ad9hCwezrn2CFOzyOu5ttnkxBd1-vfkQL6eU3a6-qGSd_SaxdNREiiyLIMJIyBPp8qQU5zM1ySi6c7LVde0JFJ3jRtgH7p5QOVD4glxgUfLkK273i69DivI0G_x3wQqkpy6FLpZa2XXOjSYwZPPm1tHc_wPVBp1zd_vF3IpLLIa_pEbA_ZsTr0HscgAA; domain=.accounts.accesscontrol.windows.net; path=/; secure; HttpOnly; SameSite=None;x-ms-gateway-slice=estsfd; path=/; secure; httponly;stsservicecookie=estsfd; path=/; secure; httponly",
"Date": "Thu, 03 Nov 2022 15:02:05 GMT",
"Content-Length": "1467",
"Content-Type": "application/json; charset=utf-8",
"Expires": "-1"
},
"effectiveIntegrationRuntime": "AutoResolveIntegrationRuntime (Central US)",
"executionDuration": 0,
"durationInQueue": {
"integrationRuntimeQueue": 0
},
"billingReference": {
"activityType": "ExternalActivity",
"billableDuration": [
{
"meterType": "AzureIR",
"duration": 0.016666666666666666,
"unit": "Hours"
}
]
}
}
The GetListData activity is triggered by the OnSuccess trigger from the GetAToken Activity. It makes a GET request to https://russellwgove.sharepoint.com/sites/tr/US/_api/Web/Lists(guid'233dd303-1ae3-422b-8960-ad53661e8ef6')/Items to get the list data. It has an Authorization header set to :
#{concat('Authorization: Bearer ', activity('GetAToken').output.access_token)}
When I debug,the GetListData activity fails with an error 2108. And a message :
Error calling the endpoint 'https://russellwgove.sharepoint.com'. Response status code: 'NA - Unknown'. More details: Exception message: 'NA - Unknown [ClientSideException] The format of value 'Authorization: Bearer {myTokenhere}' is invalid.'.
Request didn't reach the server from the client. This could happen because of an underlying issue such as network connectivity, a DNS failure, a server certificate validation or a timeout.
I have no idea what that message means 'Request didn't reach the server from the client. This could happen because of an underlying issue such as network connectivity, a DNS failure, a server certificate validation or a timeout.' What is the server and the client is this context?
Anyone has any ideas how to make this work?

Why is the output format from "Get file content using path" different for two different docs?

I'm using the action "Get file content using path" and I'm getting very different results for 2 different *.docx files which is causing problems when trying to use the output in a subsequent action.
In the one that's working properly, I get the expected output with "$content-type" and "$content" like so...
{
"$content-type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"$content": "UEsDBBQABgAIAA... blah blah blah"
}
In the one that's not working properly, I'm getting a result back, but the format is...
{
"statusCode": 200,
"headers": {
"Vary": "Origin",
"X-SharePointHealthScore": "1",
"X-MS-SPConnector": "1",
"X-SP-SERVERSTATE": "ReadOnly=0",
"DATASERVICEVERSION": "3.0",
"SPClientServiceRequestDuration": "65",
:
"X-AspNet-Version": "4.0.30319",
"X-Powered-By": "ASP.NET",
"Content-Length": "2670927",
"Content-Type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"Expires": "Wed, 22 Dec 2021 20:49:46 GMT",
"Last-Modified": "Thu, 06 Jan 2022 20:49:46 GMT"
},
"body": {
"$content-type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"$content": "UEsDBBQABgAIAAAAIQAIz... blah blah blah"
}
The issue is caused by $content being a child of the body node.
Both are *.docx files. So, why the difference in the output?
Why would one include the status code, headers, and body and the other just contains "$content-type" and "$content"?
So, I achieved the desired outcome by using a formula like such ...
if(equals(variables('JSON')?['$content'], null), variables('JSON')?['body']?['$content'], variables('JSON')?['$content'])
You just need to adapt the preceding actions to your own flow but this worked for me.
Basic Response
Extended Response

API responds with nothing when called from a Chrome extension

My issue is that I'm trying to call this API from a chrome extension:
https://wss2.cex.uk.webuy.io/v3/boxes?q=8717418549541&firstRecord=1&count=10&sortBy=relevance
Here is the code for calling the API, taken directly from Postman:
var settings = {
"async": true,
"crossDomain": true,
"url": "https://wss2.cex.uk.webuy.io/v3/boxes?q=8717418549527&firstRecord=1&count=10&sortBy=relevance",
"method": "GET",
"headers": {
"User-Agent": "PostmanRuntime/7.17.1",
"Accept": "*/*",
"Cache-Control": "no-cache",
"Postman-Token": "32322856-4e8d-4d54-87b2-199bd6181243,bea1c3bd-b5ae-4343-870d-dd73e5c88f95",
"Host": "wss2.cex.uk.webuy.io",
"Accept-Encoding": "gzip, deflate",
"Cookie": "__cfduid=dc54a227217ab713ddd4423d047c67b5f1568818173",
"Connection": "keep-alive",
"cache-control": "no-cache"
}
}
$.ajax(settings).done(function (response) {
console.log(response);
});
Using the above code has worked perfectly fine for a long time now. However, since last Thursday, the API stopped giving any response whatsoever. Now the status code says 200 OK but the response tab says "This request has no response data available". Trying to log out the response gives nothing as well.
If you were to simply click on the above API link, the JSON should get shown since there is no authorization. My extension properly sends the API call and I can see the call being sent in the network tab of Developer tools.
Calling the API from Postman, etc... works fine.
Of course, all necessary permissions are set in the manifest and everything was working well until it just suddenly stopped. No errors or warnings, nothing.
Has this happened to anyone before? Any ideas?
Thanks in advance!

Twilio Webhook with Postman request

I can't set StatusCallback to a message in Postman.
From this page I copied cURL code, imported to Postman, added authorization (it's Basic Auth), messages are sent from Twilio number to specified in "To" number. Everything works except for Webhook. As I see (by link above) there should be a "status_callback" field in response after sending a message, but it does not exist. My response is:
{
"sid": "SomeLongMessageId",
"date_created": "Mon, 20 Aug 2018 09:08:04 +0000",
"date_updated": "Mon, 20 Aug 2018 09:08:04 +0000",
"date_sent": null,
"account_sid": "myaccountsid",
"to": "+9XXXXXXXXXX3",
"from": "+14XXXXXXXX5",
"messaging_service_sid": null,
"body": "Where is webhook?",
"status": "queued",
"num_segments": "1",
"num_media": "0",
"direction": "outbound-api",
"api_version": "2010-04-01",
"price": null,
"price_unit": "USD",
"error_code": null,
"error_message": null,
"uri": "/2010-04-01/Accounts/myaccountsid/Messages/SomeLongMessageId.json",
"subresource_uris": {
"media": "/2010-04-01/Accounts/myaccountsid/Messages/SomeLongMessageId/Media.json"
}
}
Made the same thing in the code - just like in manual at the link above (Node.js):
const client = require('twilio')('myAccountSid', 'myAuthToken');
const sms = {
body: 'Will webhook work?', from: '+14XXXXXXXX5',
statusCallback: 'http://postb.in/b/BC1prY1s', to: '+9XXXXXXXXX13'
};
client.messages.create(sms).then(res => console.log(res)).done();
Same response with no "status_callback" key. I don't know, may be webhooks must be activated somewhere in Twilio account settings or what?
P.S. why the topic is changed to "Node.js - my question"? I want it to be "Twilio - My question", but tags are in the order I can't change. And topic prefix is after node.js tag
OK, looks like webhooks work even if they are not mentioned in response. I've looked into Twilio errors, it was telling that http://postb.in/b/XxXxXxXx was not reachable. And it is OK after 30 minutes of postb.in's bin existence.
Don't know why it was making webhooks after more than 30 minutes, though.
And also don't know why there is something in docs, but it doesn't exist in response.

In azure logic App how to pass Cookie to Http request

In azure logic app by calling first Http endpoint we need to get the cookie and pass to the second endpoint. But while passing second API, I am passing in header and it is sending but the response is wrong(text/html).
But When I checked by using postman it worked fine got response in JSON(application/json).
The header getting after calling second API or endpoint through logic app ,I am getting is:
{
"statusCode": 200,
"headers": {
"Cache-Control": "no-store, must-revalidate, no-cache",
"X-Powered-By": "Undertow/1",
"Set-Cookie": "JSESSIONID=Ntu9NMCoekk56JveKceina3FCwgNJptU4EK0GOIz.s192-169-141-210; path=/StLightControl",
"Server": "WildFly/10",
"Pragma": "no-cache,no-cache",
"Date": "Tue, 12 Jun 2018 14:25:45 GMT",
"Connection": "keep-alive",
"Content-Length": "2585",
"Expires": "0,0",
"Content-Type": "text/html; charset=UTF-8"
}
}
The “Add new parameter” dropdown allows you to enable a checkbox that says “Cookie” that enables you to enter the HTTP cookie (from dynamic content if you want to). You cannot enter the value straight in the dropdown, so close it down after you selected the checkbox and see a magic Cookie field appear underneath the Authentication field.
More information to be found here: HowTo: Call an API with cookie authentication from a Logic App

Resources