How to use the Azure DevOps REST API with PowerShell

Поділитися
Вставка
  • Опубліковано 17 вер 2024
  • In this video I'll show you how to use PowerShell to access the Azure DevOps REST API
    Related links:
    docs.microsoft...
    docs.microsoft...
    Gist to demo code:
    github.com/teg...

КОМЕНТАРІ • 61

  • @shobhitsharma86
    @shobhitsharma86 4 місяці тому +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!

  • @matthewbeck6847
    @matthewbeck6847 10 місяців тому +1

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

  • @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?

  • @gauravjoshi5054
    @gauravjoshi5054 3 роки тому +1

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

  • @alienzooband
    @alienzooband 3 роки тому +1

    So helpful. Really appreciated!!!

  • @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.

  • @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

  • @tattooineste
    @tattooineste 3 роки тому +1

    One word: awesome!

  • @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

  • @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?

  • @SmartCat...
    @SmartCat... 4 роки тому

    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!

  • @brijeshkothari
    @brijeshkothari 3 роки тому

    It is really nice. Thanks for sharing this info.

  • @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

  • @AminurRashidshawon
    @AminurRashidshawon 4 роки тому +1

    you are awesome. Thanks a lot

  • @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?

  • @shanayasingh7713
    @shanayasingh7713 4 роки тому

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

  • @nazishansari91
    @nazishansari91 3 місяці тому

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

    • @TegaaaSolutions
      @TegaaaSolutions  3 місяці тому

      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

  • @krishna172225
    @krishna172225 3 роки тому

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

  • @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

  • @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.

  • @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.

  • @mertyertugrul
    @mertyertugrul 2 роки тому

    I wonder how you could do this with Postman?

  • @nag449
    @nag449 4 роки тому

    Excellent

  • @nobodysaysmynameright
    @nobodysaysmynameright 4 роки тому

    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  4 роки тому

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

    • @JCDZK
      @JCDZK 4 роки тому

      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 4 роки тому

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

    • @TegaaaSolutions
      @TegaaaSolutions  4 роки тому

      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

  • @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

  • @sagarrj
    @sagarrj 4 роки тому

    How to get all Work Items? pls help

  • @anishkumarsinha
    @anishkumarsinha 4 роки тому

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

  • @harshitsharma589
    @harshitsharma589 3 роки тому

    thank you

  • @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 5 років тому

    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.

  • @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

  • @Er3t1k
    @Er3t1k 4 роки тому

    thanks

  • @Ash-ku2rz
    @Ash-ku2rz 4 роки тому

    JS code?