Harshita
Harshita

Reputation: 147

Push a zip file to azure devops

I checked the azure devops rest api documentation, couldn't found how to push a zip file using azure devops rest api. Please help with some sample code.

Upvotes: 0

Views: 2212

Answers (1)

Jane Ma-MSFT
Jane Ma-MSFT

Reputation: 5182

You can use the REST API Pushes - Create.

POST https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pushes?api-version=6.0

The request body is as same as adding a binary file. Here is the example.

You need to convert your zip file to binary, then push it.

Upvotes: 1

Related Questions