POWERSHELL AND AZURE DEVOPS THE TWO BUDDIES OF DEVOPS! Matteo Emili
WHO AM I? • Systems Engineering Advisor at One Identity • Microsoft MVP – Developer Technologies • Professional Scrum Master 1 matteo.emili@live.com || @MattVSTS || https://mattvsts.blogspot.com
I AM ONLY A POWERSHELL USER
WHY ARE YOU HERE?
A DIFFERENT PERSPECTIVE
WHAT I AM *NOT* GOING TO SHOW • Interact with Azure DevOps via VSTeam or TfsCmdlets https://www.powershellgallery.com/packages/VSTeam/4.0.10 https://github.com/igoravl/tfscmdlets • Use the Azure DevOps REST APIs for automations https://docs.microsoft.com/en-us/rest/api/vsts/?view=vsts-rest-4.1 • Deploy infrastructure via Azure Resource Manager https://mva.microsoft.com/en-us/training-courses/azure-resource- manager-devops-jump-start-8413 • Use a Version Control System (Git or TFVC) • Best practices (?)
SO, POWERSHELL AND AZURE DEVOPS…
…WHAT DO YOU MEAN?
POWERSHELL IS AN EXTREMELY POWERFUL TOOL
AUTOMATION IS ONE OF THE PILLARS OF DEVOPS
AZURE DEVOPS IS AN INTEGRATED STACK It used to be called VSTS…
THERE ARE SO MANY POINTS WHERE THEY BENEFIT FROM EACH OTHER
SOME EXAMPLES OF SYSTEM INTERACTION • Full power of PowerShell on target agent or deployment group • Deploy infrastructure with DSC or Azure Resource Manager • Create complex set of tasks to automate as much as possible • Integrate your custom scripts in a CI/CD Pipeline to make it behave like out-of-the-box tasks
SCRIPTS ARE FIRST CLASS CITIZENS • Re-use your set of scripts and re-distribute them internally as pre- packed Azure DevOps tasks • Have a consistent behaviour for free • Leverage on variables to pass parameters • Integrate your outputs with Azure DevOps logging system to provide an integrated experience for the end-user
SYSTEM INTERACTION FUNDAMENTALS Demo #1 PoSh Tasks Task Groups Azure DevOps-ification
THIS SORT OF SYSTEM INTERACTION IS EXTREMELY VALUABLE
YOU CAN EASILY PERFORM ALL THE ADVANCED DEPLOYMENT PATTERNS YOU READ AROUND
AND OF COURSE, NOT JUST IN THE CLOUD…
AZURE DEVOPS IS AN EXTENSIBLE STACK
THE EXTENSIBILITY MODEL CREATES AN ECOSYSTEM
POWERSHELL IS ONE OF THE TECHNOLOGIES AT ITS CORE
WHERE CAN YOU HAVE AN IMPACT WITH CUSTOMISATIONS?
BUILD AND RELEASE!
HOW A CUSTOM BUILD TASK IS MADE • Create the extension’s scaffolding with tfx • Add your scripts as the core portion of the custom task (targeting Windows) • Edit the manifest and (if you want) add an icon • Install the PowerShell SDK for extensions • Re-package, publish and potentially distribute to the marketplace!
AZURE DEVOPS CUSTOMISATIONS Demo #2
DO YOU EMBRACE CI/CD?
IS THERE ANY FACTOR STOPPING YOU FROM USING CI/CD FOR YOUR POWERSHELL LIBRARIES?
USE AZURE REPOS TO STORE AND VERSION YOUR SCRIPT CODE
BUILD THE NUGET PACKAGE WITH AZURE PIPELINES
DISTRIBUTE THE LIBRARY ON AN AZURE ARTIFACTS FEED
WHY SHOULD YOU DO THIS FOR APPLICATION CODE BUT NOT FOR POWERSHELL SCRIPTS?!
YOU CAN QUICKLY CREATE AN END- TO-END PIPELINE FOR YOUR LIBRARIES
YOU CAN ALSO CONTROL ITS DISTRIBUTION AND UPDATE LIFECYCLE
CI/CD FOR POWERSHELL LIBRARIES Demo #3
RECAP • Extract maximum value from out-of-the-box tasks • Integrate your PowerShell scripts with Azure DevOps Pipelines as first class citizens • Re-use set of tasks via Task Groups to share them with your teams • Create custom Build or Release Tasks as Azure DevOps Extensions, for both private and public consumption within Pipelines • Apply CI/CD concepts to your custom libraries and store them in an Artifacts feed to redistribute them for managed consumption
QUESTIONS?
THANKS!

PowerShell and Azure DevOps

  • 1.
    POWERSHELL AND AZUREDEVOPS THE TWO BUDDIES OF DEVOPS! Matteo Emili
  • 2.
    WHO AM I? •Systems Engineering Advisor at One Identity • Microsoft MVP – Developer Technologies • Professional Scrum Master 1 matteo.emili@live.com || @MattVSTS || https://mattvsts.blogspot.com
  • 3.
    I AM ONLYA POWERSHELL USER
  • 4.
  • 5.
  • 6.
    WHAT I AM*NOT* GOING TO SHOW • Interact with Azure DevOps via VSTeam or TfsCmdlets https://www.powershellgallery.com/packages/VSTeam/4.0.10 https://github.com/igoravl/tfscmdlets • Use the Azure DevOps REST APIs for automations https://docs.microsoft.com/en-us/rest/api/vsts/?view=vsts-rest-4.1 • Deploy infrastructure via Azure Resource Manager https://mva.microsoft.com/en-us/training-courses/azure-resource- manager-devops-jump-start-8413 • Use a Version Control System (Git or TFVC) • Best practices (?)
  • 7.
    SO, POWERSHELL ANDAZURE DEVOPS…
  • 8.
  • 9.
    POWERSHELL IS ANEXTREMELY POWERFUL TOOL
  • 10.
    AUTOMATION IS ONEOF THE PILLARS OF DEVOPS
  • 11.
    AZURE DEVOPS ISAN INTEGRATED STACK It used to be called VSTS…
  • 12.
    THERE ARE SOMANY POINTS WHERE THEY BENEFIT FROM EACH OTHER
  • 13.
    SOME EXAMPLES OFSYSTEM INTERACTION • Full power of PowerShell on target agent or deployment group • Deploy infrastructure with DSC or Azure Resource Manager • Create complex set of tasks to automate as much as possible • Integrate your custom scripts in a CI/CD Pipeline to make it behave like out-of-the-box tasks
  • 14.
    SCRIPTS ARE FIRSTCLASS CITIZENS • Re-use your set of scripts and re-distribute them internally as pre- packed Azure DevOps tasks • Have a consistent behaviour for free • Leverage on variables to pass parameters • Integrate your outputs with Azure DevOps logging system to provide an integrated experience for the end-user
  • 15.
    SYSTEM INTERACTION FUNDAMENTALS Demo #1 PoShTasks Task Groups Azure DevOps-ification
  • 16.
    THIS SORT OFSYSTEM INTERACTION IS EXTREMELY VALUABLE
  • 17.
    YOU CAN EASILYPERFORM ALL THE ADVANCED DEPLOYMENT PATTERNS YOU READ AROUND
  • 18.
    AND OF COURSE,NOT JUST IN THE CLOUD…
  • 23.
    AZURE DEVOPS ISAN EXTENSIBLE STACK
  • 24.
  • 25.
    POWERSHELL IS ONEOF THE TECHNOLOGIES AT ITS CORE
  • 26.
    WHERE CAN YOUHAVE AN IMPACT WITH CUSTOMISATIONS?
  • 27.
  • 28.
    HOW A CUSTOMBUILD TASK IS MADE • Create the extension’s scaffolding with tfx • Add your scripts as the core portion of the custom task (targeting Windows) • Edit the manifest and (if you want) add an icon • Install the PowerShell SDK for extensions • Re-package, publish and potentially distribute to the marketplace!
  • 29.
  • 30.
  • 31.
    IS THERE ANYFACTOR STOPPING YOU FROM USING CI/CD FOR YOUR POWERSHELL LIBRARIES?
  • 32.
    USE AZURE REPOSTO STORE AND VERSION YOUR SCRIPT CODE
  • 33.
    BUILD THE NUGETPACKAGE WITH AZURE PIPELINES
  • 34.
    DISTRIBUTE THE LIBRARYON AN AZURE ARTIFACTS FEED
  • 35.
    WHY SHOULD YOUDO THIS FOR APPLICATION CODE BUT NOT FOR POWERSHELL SCRIPTS?!
  • 36.
    YOU CAN QUICKLYCREATE AN END- TO-END PIPELINE FOR YOUR LIBRARIES
  • 37.
    YOU CAN ALSOCONTROL ITS DISTRIBUTION AND UPDATE LIFECYCLE
  • 38.
    CI/CD FOR POWERSHELLLIBRARIES Demo #3
  • 39.
    RECAP • Extract maximumvalue from out-of-the-box tasks • Integrate your PowerShell scripts with Azure DevOps Pipelines as first class citizens • Re-use set of tasks via Task Groups to share them with your teams • Create custom Build or Release Tasks as Azure DevOps Extensions, for both private and public consumption within Pipelines • Apply CI/CD concepts to your custom libraries and store them in an Artifacts feed to redistribute them for managed consumption
  • 40.
  • 41.