azure-devops-rest-api

tf.exe authenticate for vsts

家住魔仙堡 提交于 2019-12-11 02:38:14
问题 I am trying to list all the workspaces and trying to authenticate tf.exe with vsts using the below commandline. tf workspaces /Collection: https://[account].visualstudio.com/defaultcollection /login:USername,Password The vsts account is backed by Azure Active Directory synced with an on-prem AD. It works fine when I have connected to the vsts from visual studio and then running the above tf.exe command without the login switch. But, when I use the login switch for tf.exe and use the same

Complete TFS Pull Request programmatically

元气小坏坏 提交于 2019-12-11 01:27:42
问题 Using the Microsoft.TeamFoundationServer.Client (15.112.1) to connect to a TFS 2017 Update 2 server we can get details about an existing PR like this: var connection = new VssConnection(collectionUri, credentials); var client = connection.GetClient<GitHttpClient>(); var pr = await client.GetPullRequestByIdAsync(pullRequestId); Also, we can create new PR like this: var pr = await client.CreatePullRequestAsync( new GitPullRequest { SourceRefName = "master", TargetRefName = "develop", Title = "

Using VSTS Rest API, how do you Update a Markdown widget?

大城市里の小女人 提交于 2019-12-10 18:54:34
问题 I'm trying to use this REST API to Update a "Markdown" widget on a dashboard in VSTS. Using the below JSON body, per the sample, I'm getting Value cannot be null (see below)? Error Invoke-RestMethod : {"$id":"1","innerException":null,"message":"Value cannot be null.\r\nParameter name: widget","typeName":"System.ArgumentNullException,mscorlib","typeKey":"ArgumentNullException","errorCode":0,"eventId":0}At C:\Users\alex\OneDrive\Documents\Scripts\VSTSPowershell\VSTSAuthenticateAndInvoke.ps1:36

Is it possible to have a link to raw content of file in Azure DevOps

谁说我不能喝 提交于 2019-12-10 18:37:41
问题 It's possible to generate a link to raw content of the file in GitHub, is it possible to do with VSTS/DevOps? 回答1: Sure, here's the rests call needed: GET https://feeds.dev.azure.com/{organization}/_apis/packaging/Feeds/{feedId}/packages/{packageId}?includeAllVersions={includeAllVersions}&includeUrls={includeUrls}&isListed={isListed}&isRelease={isRelease}&includeDeleted={includeDeleted}&includeDescription={includeDescription}&api-version=5.0-preview.1 https://docs.microsoft.com/en-us/rest/api

API for automating Azure DevOps Pipelines?

和自甴很熟 提交于 2019-12-09 16:12:01
问题 I want to automate the queue-ing of Azure Pipelines with an API call, get information on the pipeline/build/job status, Azure Pipelines docs only mention "API" for the "Invoke HTTP Rest API" task: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/http-rest-api?view=vsts That might come in handy, but is not what I am looking for. There is a "Azure DevOps Services REST API": https://docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-5.1 But I couldn't

VSTS REST API to change security permissions on Release definition or Release definition environment

时光总嘲笑我的痴心妄想 提交于 2019-12-08 16:26:27
I cannot find any documentation referring to VSTS REST API to change security for Release Definition or Release Definition environment. I am trying to create an automation script to create a Release definition which will accept user list as a parameter and assign limited permission on the Release Definition and Release Definition environment. Is there any way of doing this? There isn’t the REST API to change permission of release definition or release environment. I submit a user voice that you can vote. REST API for release defintion or release enviornment 来源: https://stackoverflow.com

VSO REST API - Getting user profile image only works with basic authentication?

别说谁变了你拦得住时间么 提交于 2019-12-08 15:00:53
问题 I'm using the VSO REST API to get all members in a team, from there I'm getting the ImageUrl of the member. If I just bind an Image control to ImageUrl it's blank because VSO requires that I be signed in to get a profile picture... so I created a HttpClient and set my Authorization to OAuth and gave it my access token. This just returns a 403 : Forbidden response... But if I use basic authentication, then everything works fine? Is basic authentication the only method to get profile images

Assign User as an Administrator to a project once it is created using rest api - Azure DevOps

心不动则不痛 提交于 2019-12-08 10:02:24
问题 I am trying to assign a user as an administrator to a project and change the owner too via rest api in Azure DevOps. Could anyone of you point me to some documentation as how it can be done? I have looked at UserEntitlements API and Project API - but I haven't figured how I can use them for my issue. Any directions on this would be helpful. Thanks! 回答1: Assign User as an Administrator to a project once it is created using rest api - Azure DevOps Just as you know in your previous post, we

Get a list of who has what access to git repositories

白昼怎懂夜的黑 提交于 2019-12-08 07:06:44
问题 Using VSTS APIs, I'm trying to get a list of who has what access to each of our git repositories in VSTS. I have the security namespaceId for Git and I pass this namespaceId to the Security -> Access Control List API described here: https://www.visualstudio.com/en-us/docs/integrate/api/security/acls GET https://xxxxxxxx.visualstudio.com/DefaultCollection/_apis/accesscontrollists/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/?api-version=1.0&recurse=true&includeExtendedInfo=false Drilling into the

Schedule a Azure devops release in multiple timings

北战南征 提交于 2019-12-08 04:43:34
问题 I am able to schedule the release using Rest API call . Is there any way to Queue it to run Multiple times.THe code i tried is given below. $timinglist=@(1:30,2:30,3:30) foreach($time in $timinglist) { $PATtoken= 'PAT' Write-Host "Initialize Autnetication COntext" -ForegroundColor DarkBlue $token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($PATtoken)")) $header=@{authorization= "Basic $token" } $defurl = "https://vsrm.dev.azure.com/Organization/Project/_apis