cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
Anonymous
Not applicable

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

@Anonymous 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-Content-Type/m-p/475179/highlight/true#M6333

 

So far no solution...

t-tatoku
Community Support
Community Support

@Anonymous 

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.

 

Anonymous
Not applicable

@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

@Anonymous 

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 

Anonymous
Not applicable

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. 

Anonymous
Not applicable

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

@Anonymous

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

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Users online (4,604)