cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SaifAli
Helper III
Helper III

Send an HTTP Request to Azure DevOps giving error

Hi Team,

 

So till last week the step was working fine and good but suddenly it started failing without any changes made.

 

So what I was doing in below step is basically hosting an image or any other attachment to Azure DevOps as per Azure DevOps API documentation. The content bytes i'm sending is in Base64 so i've set "Body is Base64" to yes

 

21.png

 

As you can see in the above picture I'm passing the content bytes in the body which are in base64 encoded string and i've set body is base64 to yes also.

The step was good and working as expected but suddenly started giving me the following error :

 

errer.PNG

 

The request indicated a Content-Type of "" for method type "POST" which is not supported. Valid content types for this method are: application/json, application/json-patch+json, application/octet-stream.
clientRequestId: 7917cf84-34ab-4fa9-afdd-758da12ff963

 

From the error it seems like I am passing the wrong content-type , but for base64 we generally use "application/octet-stream" which I'm actually passing in the request as you can see in the 1st image. Still its not taking my content.
 
Can someone please help me in this? its really blocking my already

 

1 ACCEPTED SOLUTION

Accepted Solutions
SaifAli
Helper III
Helper III

Hi Team,

 

So I finally found the solution to the problem. But somehow its still not working with the actual step "Send an HTTP Request to Azure DevOps" but instead of that I have used a normal "HTTP" post step.

 

There's a change in which you need to pass the contents of the attachments in the body as you can see in the image below you need to add : "$content-type": "application/octet-stream; api-version=5.1" in the body of the request.

 

Also you are not able to pass the attachment content directly so you need to tweak it a little as I have done in the compose 14 step mentioned in the pic , the function inside goes like this : 

base64(base64ToBinary( body('Get_Attachment_(V2)')?['contentBytes'] ))
 
At last pass the correct body and authenticate the step with a PATS token from Azure DevOps
(choose basic authentication and then type your Organizational Username in Username and PATS token in Password)
upload.PNG

View solution in original post

11 REPLIES 11
ka05th30ry
Regular Visitor

@SaifAli I am experiencing the same issue and it appears that @kubalaml is also having the same problem.

 

See details here:

https://powerusers.microsoft.com/t5/I-Found-A-Bug/Send-an-HTTP-request-to-Azure-DevOps-errors-on-Con...

 

So far no solution...

t-tatoku
Community Support
Community Support

@SaifAli 

It seems several users experiencing similar problem.

I have checked if there is any similar cases reported, but could not find.

Please open a service request.

 

@t-tatokuJust to be clear by service request you mean to say a request to Azure DevOps Services to Microsof Support at below link 

https://azure.microsoft.com/en-us/support/devops/

 

t-tatoku
Community Support
Community Support

@SaifAli 

I meant the support request from the Power Automate.

SupportRequest.png

It will lead to the the same page as the Power Platform Help and support site as follows. 

https://admin.powerplatform.microsoft.com/support 

No Luck 😞

 

I think I need a different plan for that 😞

 

plan.PNG

After some more research and different attempts I found a solution, which was to use an Azure Function to execute the image upload and attaching to the specified Work Item. See @hammer 's comment in this thread

https://powerusers.microsoft.com/t5/Building-Flows/Create-work-item-at-Azure-DevOps-from-an-email-wi...

 

Also I believe I found the reason why the DevOps connector for "Send an HTTP request to Azure DevOps" is yielding a corrupted image. See my comment in the same thread for details. 

 

I have created a support ticket for this but at least have a working solution in the meantime. 

SaifAli
Helper III
Helper III

Hi Team,

 

So I finally found the solution to the problem. But somehow its still not working with the actual step "Send an HTTP Request to Azure DevOps" but instead of that I have used a normal "HTTP" post step.

 

There's a change in which you need to pass the contents of the attachments in the body as you can see in the image below you need to add : "$content-type": "application/octet-stream; api-version=5.1" in the body of the request.

 

Also you are not able to pass the attachment content directly so you need to tweak it a little as I have done in the compose 14 step mentioned in the pic , the function inside goes like this : 

base64(base64ToBinary( body('Get_Attachment_(V2)')?['contentBytes'] ))
 
At last pass the correct body and authenticate the step with a PATS token from Azure DevOps
(choose basic authentication and then type your Organizational Username in Username and PATS token in Password)
upload.PNG

@SaifAli

Sorry, you need to have security roles such as Office 365 Global admin or Service support admin.

https://docs.microsoft.com/en-us/power-platform/admin/get-help-support  

dbrown
Regular Visitor

Has anyone been able to get this working with Node? I am able to get the byte array from the base64 string of the attachment sent from the flow but I am still getting corrupted contents.

@dbrown , @kubalaml might know more about the problem since he has also experienced similar problem and submitted SR.

https://powerusers.microsoft.com/t5/I-Found-A-Bug/Send-an-HTTP-request-to-Azure-DevOps-errors-on-Con... 

 

Hello,

 

@t-tatoku, I stumbled upon a similar support ticket from a customer facing the same issue and started an internal thread to figure out how to fix the root cause. Could you please share the ongoing SRs on the issue so we can merge efforts? 

 

Thanks,

Wassim WEHBI 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (2,427)