The logic app in question retrieves a file attachment, from an email and puts the file in an Azure storage file share. An Office 365 email trigger is used to retrieve the email with the attachment. The file is first initialized by making a call to the Azure Files Create File REST API. If Create File is successful, the content of the file attachment is then added to the initialized file with a call to the Put Range. The problem is that the HTTP action which calls the PUT Range end point, the Content-Length header is automatically whereas the x-ms-range header has to be set in code and is derived from the attachment size property retrieved from the trigger. The x-ms-range header must be in the form x-ms-range:bytes=0-<<content length-1>>
, the Content-Length generated by the Action does not match the attachment size property and so an error (status 400) is returned:
<Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format.
</Message><HeaderName>Content-Length</HeaderName><HeaderValue>298671</HeaderValue></Error>