How to use the Azure DevOps REST API with PowerShell

Поделиться
HTML-код
  • Опубликовано: 11 фев 2019
  • In this video I'll show you how to use PowerShell to access the Azure DevOps REST API
    Related links:
    docs.microsoft.com/en-us/rest...
    docs.microsoft.com/en-us/azur...
    Gist to demo code:
    github.com/tegaaasolutions/Az...
  • НаукаНаука

Комментарии • 61

  • @matthewbeck6847
    @matthewbeck6847 9 месяцев назад +1

    The gist you provided in the description really helped improve version context visibility for my CI/CD build pipelines, thank you!!!

  • @shobhitsharma86
    @shobhitsharma86 3 месяца назад +1

    Hi, was wrecking my head trying to understand how to automate workitems handling in Azure Devops..untill I found this video. Great help for beginners at creating pipelines. Many thnks!

  • @alienzooband
    @alienzooband 3 года назад +1

    So helpful. Really appreciated!!!

  • @bmrreddy2002
    @bmrreddy2002 4 года назад

    Hello Etienne, Thanks for a great video! Do you know if it's possible to accomplish the below?
    I am trying to get a dump of all security groups and users for a certain build definition! This is equivalent to going to the Security tab in the build definition. Would you know which API can help me do a "get" for all the security groups and users for a specific build definition id?

  • @JeanCarloDeCastro
    @JeanCarloDeCastro 4 года назад

    On my RELEASE pipeline, I need to access the queue variables of my BUILD pipeline, the RELEASE pipeline is being triggered by the BUILD pipeline using CI. I read somewhere that I could use a powershell task to call devops BUILD API in order to get queue time variable an their values. Could make a tutorial indicating how to get a specific variable value for this scenario?

  • @brijeshkothari
    @brijeshkothari 3 года назад

    It is really nice. Thanks for sharing this info.

  • @AminurRashidshawon
    @AminurRashidshawon 4 года назад +1

    you are awesome. Thanks a lot

  • @tattooineste
    @tattooineste 3 года назад +1

    One word: awesome!

  • @SmartCat...
    @SmartCat... 3 года назад

    Hi, I am looking for the solution to do the following;
    One of my processes will create a text file. I need to add this file into Azure dev-ops Repo ( GIT) and then update the same file while the same process will run the second, third ... time.
    Do you have any suggestions on how to do so using a REST API + Powershell?
    TNX!

  • @gauravjoshi5054
    @gauravjoshi5054 3 года назад +1

    thanks a ton informative. Do you have video for Creating work item in release pipeline using API ...?

  • @makbaigmoghuls6382
    @makbaigmoghuls6382 2 года назад

    Clear explanation, Could you please explain to us how to create a new release (release Definition) from the same script in an existing pipeline?

  • @krishna172225
    @krishna172225 2 года назад

    Hi sir..i want to trigger a Azure Devops release pipeline using powershell

  • @sagarrj
    @sagarrj 4 года назад

    How to get all Work Items? pls help

  • @shanayasingh7713
    @shanayasingh7713 4 года назад

    Hi nicely explained! Can I use AAD token instead of personal access token?
    How can I do that?

  • @AJ-rb2yc
    @AJ-rb2yc 5 лет назад +1

    Hello Etienne thanks for your video, its very informative. Also if you can make a video on Azure Devops Pipelines approval gates with the use of invoke rest API to check the user story state in the work items and then approve as an evidence would be greatly appreciated.

    • @TegaaaSolutions
      @TegaaaSolutions  5 лет назад +1

      Sounds like a great idea. I'll add it to the video backlog

  • @nag449
    @nag449 4 года назад

    Excellent

  • @SomeBody-bk5op
    @SomeBody-bk5op 2 года назад +1

    Hello Etienne, thank
    you for the video. is it possible to get a report from ADO to list which projects are using YML pipelines vs classic pipeline? please confirm.

    • @TegaaaSolutions
      @TegaaaSolutions  2 года назад +1

      Absolutely, I’m going to get back into video production soon

  • @siddhikamat4620
    @siddhikamat4620 4 года назад +1

    Great video! Could you make a video on creating build (modify the request body) and release pipelines with azure DevOps rest API.

    • @BiohaZd5
      @BiohaZd5 3 года назад

      I need to g door this too. Please can you make a video on it.

  • @michaeledgar5715
    @michaeledgar5715 4 года назад

    Batch creation of ADO workitems possible? I would like a PS script to read a file and create a. workitem (bug) for each row in the file. Is that possible? If so any tips, general structure of which REST APIs to use, or any existing PS script out there that does this already?

    • @TegaaaSolutions
      @TegaaaSolutions  4 года назад

      You sure can. I would do a csv file or json payload then read it and iterate while add new items.

  • @pradeepvelavali9321
    @pradeepvelavali9321 5 лет назад

    Hi Etienne,
    I am trying to create a power shell script which will throw a pop-up when ever a new task/work item is created (State = New and assignedto = 'myteamname'). I am facing issues when trying to call the API with filters in query string. Can you please help me in this and suggest me on how to proceed.

    • @TegaaaSolutions
      @TegaaaSolutions  5 лет назад +1

      Pradeep V.B.H. Hi Pradeep can you share your script and I’ll see what I can do I’m not sure I understand what you are trying to do

  • @harshitsharma589
    @harshitsharma589 3 года назад

    thank you

  • @anishkumarsinha
    @anishkumarsinha 4 года назад

    Thanks ! Can we create CI /CD using Azure DevOps Rest API ?

  • @nazishansari91
    @nazishansari91 Месяц назад

    How to update existing azure wiki page, I am following the document but still not able to hit the API.

    • @TegaaaSolutions
      @TegaaaSolutions  Месяц назад

      What are you trying to do? Here is the wiki REST API page. learn.microsoft.com/en-us/rest/api/azure/devops/wiki/wikis?view=azure-devops-rest-7.1

  • @Er3t1k
    @Er3t1k 4 года назад

    thanks

  • @nobodysaysmynameright
    @nobodysaysmynameright 3 года назад

    Good video, it helped me a lot!! There just something I can't figure out how to do! I want to move my ticket to different board columns. I have, lets say, 10 and I need to cherry pick where the ticket goes! Do you have any idea?

    • @TegaaaSolutions
      @TegaaaSolutions  3 года назад

      Hum... you definitely change the board column but What do you mean by cherry-pick?

    • @JCDZK
      @JCDZK 3 года назад

      Actually figured it out! Also, do you know how can one get a list of all the available work items in a column? The REST api kind of expects you to input the IDs yourself, while in my case I just want to get whatever is in there

    • @JCDZK
      @JCDZK 3 года назад

      Sorry, it’s still me, just have two different account

    • @TegaaaSolutions
      @TegaaaSolutions  3 года назад

      I don’t off hand I would look at the site and do a few tests, you could go the other way and get a list of items and their column and check where they are, you could also write a query and get all items in a specific column (I would probably do that). Check the info on running a string query in the API docs

  • @N-et6gb
    @N-et6gb 4 года назад

    Hi Etienne,
    Thanks for the tutorial. Can you please share the script to fetch the data of all users with access level information(Basic/Stakeholder/others) ?

    • @TegaaaSolutions
      @TegaaaSolutions  4 года назад

      There is nothing to get this information at the moment, you can navigate to that that screen (where you see the levels) and on Server 2019 you have a new button Export audit log that give you this information. Nothing with the REST API Unfortunately.

    • @trendingnation7534
      @trendingnation7534 Год назад

      Hi Nawaz , did you work on this type of scenario

  • @gauravjoshi5054
    @gauravjoshi5054 3 года назад

    What we can use instead on PAT for Authenticate Azure devops API .?

    • @TegaaaSolutions
      @TegaaaSolutions  3 года назад +1

      The cloud version? PAT or Azure AD

    • @gauravjoshi5054
      @gauravjoshi5054 3 года назад +1

      Etienne Tremblay thanks for reply but can I use option under Agent job says “Allow scripts to access oauth token' is it safe to use ..?

    • @TegaaaSolutions
      @TegaaaSolutions  3 года назад

      @@gauravjoshi5054 yes that’s the way to do it. Then you use $(system.accesstoken) in your inline scripts or $env:SYSTEM_ACCESSTOKEN Inside powershell scripts also check here docs.microsoft.com/en-us/azure/devops/pipelines/build/variables?view=azure-devops&tabs=yaml#systemaccesstoken

  • @Ash-ku2rz
    @Ash-ku2rz 4 года назад

    JS code?

  • @nelsonsiva6143
    @nelsonsiva6143 4 года назад +1

    Excellent video and wat exactly which i am looking for azure DevOps is clearly explained..
    Thank you so much..
    If possible can you please share, how to send the output of this demo's in mail using powershell with same powershell script.
    Thank you in advance!

    • @TegaaaSolutions
      @TegaaaSolutions  4 года назад

      Hi Siva, check this out: docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-7 you can just add this after you run and generate a csv or txt file and it will send via your SMTP server.

    • @nelsonsiva6143
      @nelsonsiva6143 4 года назад

      @@TegaaaSolutions Thank you..!
      Another doubt is in API.. releaseCount=5, gives us latest 5 releases, but if i want to get only the latest release, then what should be the parameter should in need to mention?
      Thank you in advance!

    • @TegaaaSolutions
      @TegaaaSolutions  4 года назад

      @@nelsonsiva6143 Have you tried putting 1 instead of 5 I should return the latest one no? (disclamer I haven't tried)

    • @nelsonsiva6143
      @nelsonsiva6143 4 года назад

      @@TegaaaSolutions I've tried with putting 1, perhaps it doesn't work

    • @TegaaaSolutions
      @TegaaaSolutions  4 года назад

      Try to add &$top=1 in the URL

  • @mertyertugrul
    @mertyertugrul Год назад

    I wonder how you could do this with Postman?

  • @RifatErdemSahin
    @RifatErdemSahin Год назад

    gr8 video mate > how do i get the tasks and the last task creator and their name and date ?

    • @TegaaaSolutions
      @TegaaaSolutions  Год назад +1

      Hi Rifat, try looking at Azure DevOps extensions rest api. From there you can get extensions (task), list, update, install and uninstall, you might be able to get the info you need from there.

  • @prashantpatwari2090
    @prashantpatwari2090 5 лет назад

    Hi, this is nice solution, I implement this it's working but more than 100 record not getting in response means next page record not getting

    • @sergeykanashchuk7671
      @sergeykanashchuk7671 5 лет назад +1

      Hi
      Find $projectsUrl and paste over this:
      ------
      #Change default limit from 100 to whatever value you wish
      $urlParams = '$top=300&'
      # docs.microsoft.com/en-us/rest/api/azure/devops/core/projects/list?view=azure-devops-rest-5.0
      $projectsUrl = "$($tfsBaseUrl)_apis/projects?$($urlParams)api-version=5.0"
      ------
      This code should look nicer, but it's my first try on PS and REST API.

    • @TegaaaSolutions
      @TegaaaSolutions  5 лет назад

      @@sergeykanashchuk7671 Thanks PhD Red

  • @ArchangelWatch1337
    @ArchangelWatch1337 4 года назад

    Why would one want to use the REST API? Do you have some interesting cases in mind?

    • @TegaaaSolutions
      @TegaaaSolutions  4 года назад

      I have a ton of cases, migrating from one server to another, starting releases, updating release variables, creating special build/release reports, exporting artifacts, etc. There are plenty of opportunity to use REST APIs to do stuff.