![Upload a File to Azure DevOps using Power Automate](https://www.sharepointeurope.com/wp-content/uploads/2024/07/image-1-1.png)
Uploading a File to Azure DevOps using Power Automate
Introduction
In this blog post, we’ll explore how to automatically upload a file to an Azure DevOps repository when a new attachment is added to a SharePoint record. You can choose your desired trigger. We’ll use Power Automate to achieve this integration.
Prerequisites
Before you begin, make sure you have the following in place:
- An Azure DevOps account
- A SharePoint site
- Access to Power Automate
Steps
- Create a SharePoint List and Flow
- Get Attachments from SharePoint Record
- Get Attachment Contents
- Upload File to Azure DevOps Repository
- Use the Azure DevOps REST API to create a new file in the repository.
- Make an HTTP POST request to the following endpoint using the “Send an HTTP request to Azure DevOps” action:
- {project}/_apis/git/repositories/{repositoryId}/pushes?api-version=6.0
- In the request body, include the base64-encoded content and specify the file path.
- See Examples at: Pushes – Azure DevOps
Remember to replace placeholders like {organization}, {project}, and {repositoryId} with your actual values.
If you have any further questions or need assistance, feel free to ask!
This blog is part of Microsoft Azure Week! Find more similar blogs on our Microsoft Azure Landing page here.
About the author:
![](https://www.sharepointeurope.com/wp-content/uploads/2024/07/1704622422297-1.jpg)
As a Microsoft Certified Professional and Microsoft Learn Student Ambassador, I currently serve as a Power Platform & Dynamics 365 Consultant and Pod Lead at Cloud Surge. My dedication lies in delivering practical and user-friendly solutions, and I have a strong enthusiasm for learning and sharing knowledge. Active in the community, I find joy in helping others solve problems and have started sharing my learnings on my blog.
Reference:
Ahmad, S. (2024) Upload a File to Azure DevOps using Power Automate. Available at: Upload a File to Azure DevOps using Power Automate (shaheer365.blogspot.com) [Accessed on 24/06/2024]