Azure / logicapps

Azure Logic Apps labs, samples, and tools
MIT License
368 stars 302 forks source link

Azure Logic Apps: Unable to Attach File to Azure DevOps Work Item via API - "Body parameters are not specified." #1236

Open pr081578 opened 1 week ago

pr081578 commented 1 week ago

Describe the Bug with repro steps

Set Up Logic App:

Add an action to retrieve an email attachment (Get Attachment from Office 365, for example).

Ensure the attachment content is available as a base64 string.

Add a Compose Action (Optional):

Use the expression base64ToBinary() to decode the attachment content into binary format:

base64ToBinary(outputs('Get_Attachment')?['body'])

Add HTTP Action to Upload the Attachment:

Method: POST

URI:

https://dev.azure.com/{organization}/{project}/_apis/wit/attachments?fileName={fileName}&api-version=6.0

Headers:

{

"Content-Type": "application/octet-stream",

"Authorization": "Bearer {PersonalAccessToken}"

}

Body: Pass the binary output from the Compose step or the base64 content directly.

Run the Logic App:

Trigger the Logic App to upload an attachment to Azure DevOps.

Observe the response from the Azure DevOps API.

What type of Logic App Is this happening in?

Consumption (Portal)

Which operating system are you using?

MacOS

Are you using new designer or old designer

New Designer

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

Workflow JSON

{
  "status": 400,
  "message": "Body parameters are not specified.\r\nclientRequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "error": {
    "message": "Body parameters are not specified."
  },
  "source": "vsts-ncus.azconn-ncus-001.p.azurewebsites.net"
}

Screenshots or Videos

No response

Browser

Safari

Additional context

No response