question

RichardWilkinson-5413 avatar image
0 Votes"
RichardWilkinson-5413 asked MayankBargali-MSFT answered

Get file content from a blob gets an octet-stream. When I try to use that "File Content" later in the flow, it comes out as the original XML text (readable) which is breaking my HTTP request

I have a Logic App that monitors a blob storage container for an XML to show up, then I do a "Get Blob Content using Path" to grab the XML content. I then use that content later in the flow to send in an HTTP request (to an Azure Function that then zips it up and returns the zip file as an output). When I run the flow, I see the output of the Get Blob Content as:
{
"$content-type": "application/octet-stream",
"$content": "77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxEb2N1bWVuxxxx=="
}

I then use that output in my HTTP POST action, and I now see the readable XML instead. I'm pretty sure its failing because of the content type being sent.
{
"$content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Document>\r\n\t<VENDINVOICEJOURNALHEADERENTITY JOURNALBATCHNUMBER=\"123456789\" DESCRIPTION=\"AP Invoice\"XXXXXXX",
"$content-type": "application/octet-stream"
}

I have tried changing the "$content-type" to application/xml, text/xml and nothing works. Funny thing though, I have this working with no issues in the Power Automate "FLOW" portal. The main difference is that the HTTP content I am sending in the body is an octet-stream! Is there an easy way to force that?

143477-image.png143517-image.png


azure-logic-apps
image.png (70.5 KiB)
image.png (79.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MayankBargali-MSFT avatar image
0 Votes"
MayankBargali-MSFT answered MayankBargali-MSFT edited

@RichardWilkinson-5413 I have used the below logic app and I couldn't observe the issue at my end. I am only assigning the File Content object to the Body parameter of my HTTP action. You don't have to initialize the variable and assign the File Content. You can directly use it in your HTTP action as I have used in my below workflow.

Logic App Workfow:
144822-image.png


The output of HTTP action is the same as below when I have selected Infer content type as Yes or No. The only changes will be to the Get Blob Content V2 action output i.e one will have the actual XML string as output (when you select Yes) while the other has $content-type and $content parameter (when you select No) in the output of Get Blob Content V2 action.

144785-image.png

Output at Function app end:
144808-image.png

Hope the above helps you to resolve the issue. Feel free to get back to me if you need any assistance.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.