Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Automate Azure DevOps

Automate Azure DevOps

Need to setup a new project? Script and automate the creation of repos and git ignore files. Create your build pipelines, branch policies and release in a repeatable manner. Let's examine the Azure cli devops extension and REST apis to find out how to script almost everything in Azure DevOps.

Associated code at: https://github.com/Codebytes/automatingAzureDevOps

Ed0195c951a51ca754ba19eb92a98e3f?s=128

Chris Ayers

October 19, 2019
Tweet

Transcript

  1. Automating Azure DevOps Chris Ayers

  2. Chris Ayers Azure / Devops Consultant • Chris.Ayers@NewSignature.com • Twitter:

    @Chris_L_Ayers • linkedin.com/in/chris-l-ayers/ • Blog: https://chrislayers.com/ • Github: https://github.com/Codebytes
  3. Agenda Azure DevOps • Features • Boards • Repos •

    Pipelines • Artifacts • Test Plans What Can We Do? • Automate • Integrate How Can We Interact? • Rest API • Azure CLI
  4. What is DevOps?

  5. None
  6. DevOps is… DevOps is the union of people, process, and

    products to enable continuous delivery of value to your end users. “ ”
  7. What is Azure DevOps?

  8. Azure Boards Azure Repos Azure Pipelines Azure Test Plans Azure

    Artifacts Deliver with Azure DevOps
  9. Azure Boards Azure Repos Azure Pipelines Azure Test Plans Azure

    Artifacts Connecting ideas to releases Scrum ready to help your teams run sprints, stand- ups, and plan work Integrated with GitHub commits and pull requests Insights into project status and health
  10. Azure Boards Azure Repos Azure Pipelines Azure Test Plans Azure

    Artifacts Deliver Private Git and TFVC repos for your teams Code review via branch pull requests Branch policies and build validation Easy migration path to / from GitHub
  11. Azure Boards Azure Repos Azure Pipelines Azure Test Plans Azure

    Artifacts Deliver Cloud-hosted pipelines for Linux, macOS and Windows Any language, any platform, any cloud Native support for containers and Kubernetes Best-in-class for open source
  12. Azure Boards Azure Repos Azure Pipelines Azure Test Plans Azure

    Artifacts Deliver Deploy to on-premises, ANY cloud or a hybrid of cloud and on-prem Staged environment releases Pre and post deployment approvals with gates to automate approval based on conditions
  13. Azure Boards Azure Repos Azure Pipelines Azure Test Plans Azure

    Artifacts Deliver Share code efficiently Keep your Maven, npm, NuGet and Python packages and more in the same place Aggregate from public registries and internal teams Publish and track from any pipeline
  14. Azure Boards Azure Repos Azure Pipelines Azure Test Plans Azure

    Artifacts Deliver Run tests and log defects from your browser Track and assess quality throughout your lifecycle Capture rich data for reproducibility Create tests directly from exploratory sessions
  15. What can we do? • Automate • Integrate

  16. Automate • Team project creation • Repository creation • Branch

    policy creation • Builds • Releases • Reports
  17. Integrate • Gates • Custom Applications • Custom Dashboards •

    External Reporting • Custom Workflows
  18. How Can We Interact?

  19. Examples GUI based client side application Headless text only client

    side application GUI based web application Azure DevOps Services extension
  20. Authentication ADAL OAUTH DEVICE PROFILE PAT CLIENT LIBRARY

  21. PAT

  22. Let’s focus on REST

  23. Documentation https://tinyurl.com/DevOpsRestApi https://docs.microsoft.com/en- us/azure/devops/dev-resources

  24. Rest API VERSIONED JSON CORS RATE LIMITS

  25. URI - VERB https://{instance}[/{team-project}]/_apis[/{area}]/{resource} ?api-version={version} Instance dev.azure.com/{organization} {server:8080)}/tfs/{DefaultCollection} Team-project Application

    Resource build/builds/{buildId} git/repositories/{repositoryId}/pullrequests Version 5.1 - Azure DevOps Server vNext 5.0 - Azure DevOps Server 2019 4.1 - TFS 2018 Update 3
  26. Powershell

  27. Let’s go to the code

  28. What about our other options?

  29. Azure DevOps Extension for Azure CLI

  30. Azure DevOps Extension for Azure CLI WINDOWS, LINUX, MAC, DOCKER

    AZURE CLOUD SHELL JSON ACTIVELY DEVELOPED AUTODETECTION
  31. Azure DevOps Extension for Azure CLI

  32. Azure CLI

  33. Questions?