azure-devops-rest-api

How to add a user to Azure DevOps using it's python client API?

冷暖自知 提交于 2019-12-02 12:51:35
问题 I am writing a python script to add a user(an existing user from the AAD backed provider) to Azure DevOps. I am using python client library of Azure DevOps for this purpose. After authentication, I am able to fetch the users from azure devops as: # Create a connection to the org credentials = BasicAuthentication('', personal_access_token) connection = Connection(base_url=organization_url, creds=credentials) # Get a client (the "graph" client provides access to list,get and create user) graph

Getting a '403 Forbidden' when calling the Pull Request API on VSTS

孤街醉人 提交于 2019-12-02 12:38:28
For other APIs that I'm calling (including Analytics), it all seems to work fine, but when I try to make any Pull Request queries, I get a 403 Forbidden . The calls are being made by my private Windows agent with PAT authorised with all scopes. It is using @{Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"} . Is there some other permission I need to set somewhere? Edit 1: If I use $header = @{Authorization = "Basic <hard coded base64 encoded string used in the header for my Postman queries>"} , it works. You need to grant Contribute to pull requests permission to Project Collection Build

How to Add test results to a test run in VSTS using Rest API programatically

こ雲淡風輕ζ 提交于 2019-12-02 11:48:50
I've got API link for this task POST https://{instance}/DefaultCollection/{project}/_apis/test/runs/{run}/results?api-version={version} https://www.visualstudio.com/en-us/docs/integrate/api/test/results#add-test-results-to-a-test-run I need program to do through API way. Alternative, i've tried with program below public void GetResult() { var u = new Uri("https://{UserAccount}.visualstudio.com"); VssCredentials c = new VssCredentials(new Microsoft.VisualStudio.Services.Common.VssBasicCredential(string.Empty, "MyPAT")); var connection = new VssConnection(u, c); var testClient = connection

Get all organizations in Azure DevOps using REST API

杀马特。学长 韩版系。学妹 提交于 2019-12-02 11:21:14
问题 I am trying to retrieve all the organizations in my account but in the documentation an organization is always required in the API call. https://dev.azure.com/{organization}/_apis/... 回答1: If you load the current landing page, it displays all your organizations tied to your account. I assumed it had to get that information some way. I captured the network traffic and I believe you could get to the data you want using a system API call. However, it might change or might become unsupported

Use VSTS Rest API to set git repo permissions

梦想的初衷 提交于 2019-12-02 08:56:13
问题 Is there a way using the VSTS rest API to set permissions on a git repo? I've got a script that creates a repo, and I want to extend that to set some default permissions (give the project collection build service contribute permissions). I've read the gui docs and looked through the Rest API docs but can't see that I can set permissions on a repo through the API. Is it possible? 回答1: For now, REST API can not set version control permissions (including git repo). I posted an user voice Set

Populate data in to VSTS release summary tab

喜你入骨 提交于 2019-12-02 07:35:50
I am trying to create a release without mapping a existing build in TFS/VSTS and get data display in release summary once it is completed. in plain text steps are following Release -> Empty Release Definition -> Add build task - > Create Release -> Deploy -> View Data in Summary Section Summary data are view-able as expected without any issues with following two scenarios Build - > Create build definition -> Add task - > Save and Queue build – Build Success - > View Summary Data Release -> Empty Release Definition -> Link pre-defined Build definition -> Create Release -> provide successfully

TFS Rest API check-in to Version Control

☆樱花仙子☆ 提交于 2019-12-02 06:54:27
问题 From a VSTS extension I need to be able to check-out, edit, and check-in (on-prem TFVC/TFS repo v2015.3) In the documentation https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/overview it is not clear if there is an APi to do that MSFT implemented it for their own Web Access "Code" Editor use: https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/2216206-provide-check-in-check-out-functionality-through-t#{toggle_previous_statuses} So, there is a way to achieve

TFS Rest API check-in to Version Control

瘦欲@ 提交于 2019-12-02 06:44:52
From a VSTS extension I need to be able to check-out, edit, and check-in (on-prem TFVC/TFS repo v2015.3) In the documentation https://www.visualstudio.com/en-us/docs/integrate/api/tfvc/overview it is not clear if there is an APi to do that MSFT implemented it for their own Web Access "Code" Editor use: https://visualstudio.uservoice.com/forums/330519-team-services/suggestions/2216206-provide-check-in-check-out-functionality-through-t# {toggle_previous_statuses} So, there is a way to achieve this. I`ve tried to reverse engineer how they did it per Browser Debugging, but the minified/bundled

Use VSTS Rest API to set git repo permissions

无人久伴 提交于 2019-12-02 05:39:23
Is there a way using the VSTS rest API to set permissions on a git repo? I've got a script that creates a repo, and I want to extend that to set some default permissions (give the project collection build service contribute permissions). I've read the gui docs and looked through the Rest API docs but can't see that I can set permissions on a repo through the API. Is it possible? For now, REST API can not set version control permissions (including git repo). I posted an user voice Set version control permissions by REST API for this feature, you can vote and follow up. 来源: https://stackoverflow

Populate data in to VSTS release summary tab

家住魔仙堡 提交于 2019-12-01 09:53:23
问题 I am trying to create a release without mapping a existing build in TFS/VSTS and get data display in release summary once it is completed. in plain text steps are following Release -> Empty Release Definition -> Add build task - > Create Release -> Deploy -> View Data in Summary Section Summary data are view-able as expected without any issues with following two scenarios Build - > Create build definition -> Add task - > Save and Queue build – Build Success - > View Summary Data Release ->