How to use the Azure DevOps REST API with PowerShell

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ต.ค. 2024

ความคิดเห็น • 61

  • @matthewbeck6847
    @matthewbeck6847 ปีที่แล้ว +1

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

  • @shobhitsharma86
    @shobhitsharma86 6 หลายเดือนก่อน +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!

  • @makbaigmoghuls6382
    @makbaigmoghuls6382 2 ปีที่แล้ว +1

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

  • @alienzooband
    @alienzooband 3 ปีที่แล้ว +1

    So helpful. Really appreciated!!!

  • @tattooineste
    @tattooineste 3 ปีที่แล้ว +1

    One word: awesome!

  • @brijeshkothari
    @brijeshkothari 3 ปีที่แล้ว

    It is really nice. Thanks for sharing this info.

  • @AminurRashidshawon
    @AminurRashidshawon 4 ปีที่แล้ว +1

    you are awesome. Thanks a lot

  • @gauravjoshi5054
    @gauravjoshi5054 4 ปีที่แล้ว +1

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

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

  • @nazishansari91
    @nazishansari91 4 หลายเดือนก่อน

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

    • @TegaaaSolutions
      @TegaaaSolutions  4 หลายเดือนก่อน

      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

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

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

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

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

  • @krishna172225
    @krishna172225 3 ปีที่แล้ว

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

  • @shanayasingh7713
    @shanayasingh7713 4 ปีที่แล้ว

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

  • @nag449
    @nag449 4 ปีที่แล้ว

    Excellent

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

  • @harshitsharma589
    @harshitsharma589 3 ปีที่แล้ว

    thank you

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

  • @mertyertugrul
    @mertyertugrul 2 ปีที่แล้ว

    I wonder how you could do this with Postman?

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

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

  • @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 4 ปีที่แล้ว

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

    • @TegaaaSolutions
      @TegaaaSolutions  4 ปีที่แล้ว +1

      The cloud version? PAT or Azure AD

    • @gauravjoshi5054
      @gauravjoshi5054 4 ปีที่แล้ว +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  4 ปีที่แล้ว

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

  • @Er3t1k
    @Er3t1k 4 ปีที่แล้ว

    thanks

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

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

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

  • @Ash-ku2rz
    @Ash-ku2rz 4 ปีที่แล้ว

    JS code?