Logic App Standard workflow trigger failing - azure

We created a logic app standard that uses a service bus api connection. When looking in the tab "Connections" it says that the connection is in the "Connected" status.
The problem is that the trigger of the workflows fails and the Outputs json is the following:
{
"statusCode": 401,
"headers": {
"Cache-Control": "no-store, no-cache",
"Pragma": "no-cache",
"x-ms-request-id": "xxxx",
"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",
"x-ms-apihub-obo": "true",
"Date": "Wed, 20 Jul 2022 15:21:08 GMT",
"Content-Length": "287",
"Content-Type": "application/json",
"Expires": "-1"
},
"body": {
"status": 401,
"message": "Key 'token' not found in connection profile.\r\nclientRequestId: 0b492f59-bca5-4901-8132-b0ce10416d25",
"error": {
"message": "Key 'token' not found in connection profile."
},
"source": "servicebus-xxx.azurewebsites.net"
}
}
What can possibly be the issue here?
Can this possibly be due to permission restrictions?

Related

Azure Translator API always gives me 404

I'm trying to use translator API through a free trial subscription. After creating it, I set resource groups and add cognitive service to it. On that cognitive service page, I followed the "Quick Start" guide and got a pair of keys and ENDPOINT url.
Then I followed this document. It says an API key and endpoint are needed to use translator API. And I get them from RESOURCE MANAGEMENT>Keys and Endpoint section.
https://learn.microsoft.com/en-gb/azure/cognitive-services/translator/quickstart-translate?pivots=programming-language-javascript
But I always get 404 status code from this API every time I send a request. Is there anything I do wrong? How can I use this API?
SubscriptionID: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
My code:
const subscriptionKey = 'my-sub-key'; // There are two keys, key1 and key2. I use key1 here.
const endpoint = 'https://japaneast.api.cognitive.microsoft.com/';
const options = {
method: 'POST',
baseUrl: endpoint,
url: 'translate',
qs: {
'api-version': '3.0',
'to': 'en'
},
headers: {
'Ocp-Apim-Subscription-Key': subscriptionKey,
'Content-type': 'application/json',
'X-ClientTraceId': uuidv4().toString()
},
body: [{
'text': 'hello world'
}],
json: true,
};
request(options, function (err, resFromMicrosoft, body) {
res.json(resFromMicrosoft);
}
Error response:
{
"statusCode": 404,
"body": {
"error": {
"code": "404",
"message": "Resource not found"
}
},
"headers": {
"content-length": "56",
"content-type": "application/json",
"apim-request-id": "e2ae69cc-b93c-4db2-aef4-47096eb3ec61",
"strict-transport-security": "max-age=31536000; includeSubDomains; preload",
"x-content-type-options": "nosniff",
"date": "Fri, 19 Jun 2020 06:11:24 GMT",
"connection": "close"
},
"request": {
"uri": {
"protocol": "https:",
"slashes": true,
"auth": null,
"host": "japaneast.api.cognitive.microsoft.com",
"port": null,
"hostname": "japaneast.api.cognitive.microsoft.com",
"hash": null,
"search": "?api-version=3.0&to=en",
"query": "api-version=3.0&to=en",
"pathname": "/translate",
"path": "/translate?api-version=3.0&to=en",
"href": "https://japaneast.api.cognitive.microsoft.com/translate?api-version=3.0&to=en"
},
"method": "POST",
"headers": {
"Ocp-Apim-Subscription-Key": "my-sub-key",
"Content-type": "application/json",
"X-ClientTraceId": "8eedf6f4-db0c-45cb-a95b-92a2797df067",
"accept": "application/json",
"content-length": 83
}
}
}
As mentioned in the documentation, please use the global endpoint - https://api.cognitive.microsofttranslator.com/
I saw your comment about getting 401 after using the global endpoint.
You still need to use the global endpoint as mentioned by Swetha.
This might help https://github.com/MicrosoftDocs/azure-docs/issues/57430#event-3480744006
(From the above page)
"It looks like you are using a common cognitive service resource and a key. Most the services have moved to using an individual resource type and if you can create and use the translator resource the steps mentioned in the documentation should work as is."

Internal error AsyncOperationConflictException when trying processing Azure Analysis Service

When I try to process my Azure Cube, I get the following error:
{
"statusCode": 409,
"headers": {
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"x-ms-root-activity-id": "6xxx82d1-xxxx-4613-9ca5-xxxxxxxxxx",
"x-ms-current-utc-date": "3/5/2019 4:00:25 PM",
"x-ms-xmlaerror-extended": "Internal error AsyncOperationConflictException_Message1.CUBENAME",
"Date": "Tue, 05 Mar 2019 16:00:26 GMT",
"Server": "Microsoft-HTTPAPI/2.0",
"Content-Length": "296",
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"code": "Conflict",
"subCode": 1,
"message": "Internal error AsyncOperationConflictException_Message1.CUBENAME",
"timeStamp": "2019-03-05T16:00:26.2644538Z",
"httpStatusCode": 409,
"details": [
{
"code": "RootActivityId",
"message": "6xxx82d1-f39e-xxxx-9ca5-xxxxxxxxxx"
},
{
"code": "Param1",
"message": "inspire"
}
]
}
}
A brief explanation:
I try to process my cube in logic apps. In the following figure in step 1 I scale out my Azure AS, then in step 2 set the parameter and in step 3 I get the error:
Do you have any idea why I get this error?

Parse multipart/related response and save attachment to file

I'm doing a simple POST that returns the below. I'm expecting a .txt.gz file. I need to know how to retrieve the attachment. I've tried creating a buffer, delimiting, and splitting before writing the file, but it always comes back as corrupt.
The request library explains how to consume a PUT request for an attachment, but not how to consume a response back.
Can anyone help? Been at this for a week now.
JSON.stringify(res)
{
"statusCode": 200,
"body": {
"type": "Buffer",
"data": [
13,
10,
45,
45(..truncated)
]
},
"headers": {
"set-cookie": [
"JSESSIONIDSSO=982EF51351B9497045DB6AB5A2D50DBF; Path=/; Secure; HttpOnly",
"JSESSIONID=995EF8A4A893860159CE463582E4CDDD; Path=/logcollectionservice; Secure; HttpOnly",
"SoapSession.id=-2851099334472488788"
],
"x-frame-options": "SAMEORIGIN",
"strict-transport-security": "max-age=31536000; includeSubdomains",
"content-type": "multipart/related; type=\"text/xml\"; start=\"<852C508C64251E692C9217DFA4EB7433>\"; boundary=\"----=_Part_109_17473961.1526352793275\"",
"transfer-encoding": "chunked",
"date": "Tue, 15 May 2018 02:53:13 GMT",
"connection": "close",
"server": ""
},
"request": {
"uri": {
"protocol": "https:",
"slashes": true,
"auth": null,
"host": "50.22.22.22:8443",
"port": "8443",
"hostname": "50.22.22.22",
"hash": null,
"search": null,
"query": null,
"pathname": "/logcollectionservice/services/DimeGetFileService",
"path": "/logcollectionservice/services/DimeGetFileService",
"href": "https://50.22.22.22:8443/logcollectionservice/services/DimeGetFileService"
},
"method": "POST",
"headers": {
"Authorization": "Basic YWRt123123123123123123",
"SOAPAction": "http://schemas.cisco.com/ast/soap/action/#LogCollectionPort#GetOneFile",
"content-length": 467
}
}
}
res.body
------=_Part_183_12814895.1526363698144
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-Id: <5DDAB109C3B14685FF6B0EA83D2CF8E4>
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body>
<ns1:GetOneFileResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://schemas.cisco.com/ast/soap/"><DataHandler
href="cid:36F92AA211EE04B422D4B07AB07D841A" xsi:type="ns2:DataHandler"
xmlns:ns2="DimeGetFileService"/></ns1:GetOneFileResponse>
</soapenv:Body></soapenv:Envelope>
------=_Part_183_12814895.1526363698144
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Id: <36F92AA211EE04B422D4B07AB07D841A>
����o�:���W��U����<��퐖.�I��8!h�0�l��?~���m�z��;'����>��oL���'Ϗ��3
'�tSV�EO�8zÂ���[a0����.��`�4wbO�q��FI���:�n܍>��e-
��!^#"�U5��;��^����U[V���s˽��q_��̣
����{gm����r��
���c��㬌Pf]Z�����cs���#ߵ� (truncated)
------=_Part_183_12814895.1526363698144--

Google Street View Publish return's "Photo does not have upload reference." after statusCode 200

I'm using NodeJS to upload panoramic images.
When I make #2 informed in the Google documentation, I get the following return:
Request
{
"url": "UPLOAD_URL",
"body": "/PATH_TO_PANO/pano.jpg",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "image/jpeg"
}
}
Response
{
"statusCode": 200,
"body": "",
"headers": {
"x-guploader-uploadid": "AEnB2UoJt4gvmmU6gXZvWDRu4b0DUCeT5vuPKLGcZqM4Tzo9HssCLoloTgAACRmxmP0U5DDYvHXpThCjRslW80bEKLZjUjJB3QNZ5w- j0jd8jdtVnH8X0c",
"content-length": "0",
"date": "Tue, 26 Sep 2017 21:05:17 GMT",
"server": "UploadServer",
"content-type": "text/html; charset=UTF-8",
"alt-svc": "quic=\":443\"; ma=2592000; v=\"39,38,37,35\"",
"connection": "close"
},
"request": {
"uri": {
"protocol": "https:",
"slashes": true,
"auth": null,
"host": "streetviewpublish.googleapis.com",
"port": 443,
"hostname": "streetviewpublish.googleapis.com",
"hash": null,
"search": null,
"query": null,
"pathname": "/media/user/USER_ID/photo/PHOTO_ID",
"path": "/media/user/USER_ID/photo/PHOTO_ID",
"href": "https://streetviewpublish.googleapis.com/media/user/USER_ID/photo/PHOTO_ID"
},
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "image/jpeg",
"content-length": 45
}
}
}
But when I upload the metadata of the photo, I get the following message:
Request
{
"url": "https://streetviewpublish.googleapis.com/v1/photo?key=YOUR_API_KEY",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json",
"Content-Length": 9385487
},
"data": {
"uploadReference": {
"uploadUrl": "UPLOAD_URL"
},
"pose": {
"heading": 110,
"latLngPair": {
"latitude": -29.937386,
"longitude": -60.996952
}
},
"captureTime": {
"seconds": 1506448064836
}
}
}
Response
{
"error": {
"code": 400,
"message": "Photo does not have upload reference.",
"status": "INVALID_ARGUMENT"
}
}
There are not many references to basing myself and finding the problem. For that reason I would like the help of someone who may have gone through something similar.
I have replicated your issue. I've encountered this error when I didn't specify the UPLOAD_URL in the request.
{
"error": {
"code": 400,
"message": "Photo upload url does not match required format.",
"status": "INVALID_ARGUMENT",
"details": [
{
...
}
]
}
}
Make sure that you have added the UPLOAD_URL in the request. Check this documentation for more information.

box.com node client - cannot access files created by collaborator

I'm the co-owner on a box.com file.
My boss is the owner.
I'm using https://www.npmjs.com/package/box-node-sdk to manage the files
The node client has my bosses' enterprise credentials
He made a folder
I made several other sibling folders
I can retreive his
I can't retreive mine
We're both listed as collaborators on all the files
The error I get looks like this:
{
"statusCode": 404,
"response": {
"statusCode": 404,
"body": {
"type": "error",
"status": 404,
"code": "not_found",
"context_info": {
"errors": [
{
"reason": "invalid_parameter",
"name": "item",
"message": "Invalid value 'd_11786923812'. 'item' with value 'd_11786923812' not found"
}
]
},
"help_url": "http://developers.box.com/docs/#errors",
"message": "Not Found",
"request_id": "338009555580a32f872f7c"
},
"headers": {
"server": "ATS",
"date": "Fri, 21 Oct 2016 15:23:36 GMT",
"content-type": "application/json",
"content-length": "324",
"cache-control": "no-cache, no-store",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"vary": "Accept-Encoding",
"age": "0",
"connection": "keep-alive"
},
"request": {
"uri": {
"protocol": "https:",
"slashes": true,
"auth": null,
"host": "api.box.com",
"port": 443,
"hostname": "api.box.com",
"hash": null,
"search": null,
"query": null,
"pathname": "/2.0/folders/11786923812",
"path": "/2.0/folders/11786923812",
"href": "https://api.box.com/2.0/folders/11786923812"
},
"method": "GET",
"headers": {
"User-Agent": "Box Node.js SDK v1.1.0",
"Authorization": "[REMOVED BY SDK]",
"accept": "application/json"
}
}
}
}
EDIT: So, I can get folder 0 and it's not where I'm looking BUT, I did check earlier and added a file where I thought I was looking and it did show up, so I'm guessing that my boss would have to create the files...

Resources