Questions tagged [azure-devops-rest-api]

Azure DevOps Services REST API (previously: Visual Studio Team Services REST APIs) is a set of APIs allowing management of Azure DevOps (formerly: Visual Studio Team Services) accounts as well as TFS 2015/2017/2018/2019 servers.

What's your goal? APIs to use:

  • Accounts and Profiles
    • Access user accounts or profiles
  • Build (2.0)
    • Automatically kick off a build
    • Get details from a completed build
    • Add a tag to a build
  • Widgets
    • Add a widget to a dashboard
  • Git
    • Get Git repositories
    • Add status to a commit
    • Get details/status for a pull request
    • Create a file (push)
  • Project and Teams
    • Create a project
    • Get a list of projects
  • Work Item Tracking
    • Get a list of work items
    • Create a work item
    • Update a work item
    • Add a link to a work item

More Information

1869 questions
5
votes
2 answers

Download a file from azure devops server writes wrong data to the file

I am trying to download a SQL file from azure devops server using the API, but an html page source code with signout link is copied to the file. C# Code var personalaccesstoken = "wwwwwwwwwwwwwwwwwwy47b7ugkz32bubi64bw7fqdyfpa"; var url =…
user13812143
5
votes
2 answers

Azure DevOps wiki .attachments folder

is there a way to browse ".attachments" folder from the Azure DevOps wiki page? I insert images, later want to check folder content but not find a way to do it.
5
votes
2 answers

How to link a branch and work item in Azure DevOps programmatically

I'm trying to find a way to add a branch as a link in Azure DevOps through an application I'm building (Basically just this, but within a C# console app). I'm becoming familiar with the VisualStudio Services and TeamFoundation .NET libraries and…
Nathan
  • 435
  • 4
  • 16
5
votes
1 answer

Azure DevOps get commits linked to a work item via the REST API

Is there a way to get Git Commits that are linked to a work item given only the work item ID? I'm using PowerShell and this URI to get work items, but I don't see any of the linked commits on the returned object. I also don't see any documentation…
Zam
  • 1,121
  • 10
  • 27
5
votes
4 answers

Is there a way I can re-initiate failed tasks or agent phase in a TFS release?

When a certain task fails in an environment I had to always redeploy the whole environment after fixing the issue. Is there a way I could re-initiate only the failed task or just the phase where the task is failed. For example: In the screenshot…
Fairoz
  • 828
  • 2
  • 8
  • 21
5
votes
4 answers

Azure DevOps Set Build number variable in a Build Task

In Azure DevOps, I created a Build. In that Build I created a ProjectBuildNumber Pipeline variable that is Settable at queue time. That variable is then used under Options -> Build number format to set my build number displayed in Azure. However, I…
Nathan
  • 675
  • 2
  • 9
  • 20
5
votes
2 answers

How to use output variables across agent jobs in azure release pipeline

In my azure release pipeline I have 2 agent jobs, one is for sql deployment using power-shell and other is for kubernetes using power-shell. How to set an output variable in 1st agent job and use that in second agent job using power-shell.
5
votes
1 answer

Is there an equivalent for server side .gitattributes in Azure DevOps?

My team maintains a JSON file with a dictionary of GUIDs to version images our service consumes correctly. Two developers can have distinct changes but for the same entry, so when they overwrite the same line in the file, then whoever commits later…
Paul Epperson
  • 191
  • 1
  • 7
5
votes
1 answer

How to call a webhook only when a pull request has been successfully merged into master?

We are using Azure DevOps webhooks to call into our service from our customers projects. The intention is to seamlessly perform some actions over their repository once they've completed a PR into master branch. In my tests, I've set up a webhook…
ElFik
  • 897
  • 2
  • 13
  • 31
5
votes
1 answer

Accessing "Remaining Work" on PBI through REST API

On the sprint board in Azure DevOps the "Remaining work" value on tasks "roll up" to e.g. PBI's and are displayed on the PBI card. This value does not appear to be persisted on the "Remaining work" field on a PBI. If I try to access this field…
5
votes
2 answers

How to get valid AAD v2 token using MSAL.js for Azure DevOps

ADAL.js and AAD v1 works to access Azure DevOps using delegated user_impersonation scope. I used the same AAD Application Id with delegated permissions to generate access tokens using MSAL.js. The tokens were created successfully, but the access…
5
votes
2 answers

Having no permission for updating Variable Group via Azure DevOps REST API from running Pipeline

In a nutshell, I am trying to update a Variable Group when executing a PowerShell script from a build Pipeline (increasing a build number, but this part is not so important). As it suggested in this topic and Azure DevOps docs I use code similar…
Agat
  • 4,577
  • 2
  • 34
  • 62
5
votes
1 answer

VSTS pass parameter in Pipeline between stages

I have two stages in my pipeline. The first one is the trigger for the second one. I want the parameter from first stage be input/accessible in the second stage. Is this feasible? EDIT The case is when the parameter value is set on stage 1 as of…
5
votes
3 answers

How best to download source files from VSTS?

I need to regularly download a complete set of latest code for a particular project from a VSTS account (server workspace), to a folder on a file server for readonly archiving. Currently I log on to the web portal and click Download as ZIP for the…
userSteve
  • 1,554
  • 1
  • 22
  • 34
5
votes
1 answer

Microsoft Flow Add Outlook attachment to VSTS Work Item

I'm trying to get an Outlook attachment uploaded to VSTS (using the Send an HTTP request to VSTS action). I have everything else working. Including added the attachment to the ticket, but the "uploaded" file is nothing. I've tried every combination…