Continuous Delivery
with Visual Studio Team Services, Azure Resource
Manager, Azure VM ScaleSets, and Powershell DSC
Justin Barias
Readify
Agenda
• Brief primer on DevOps
• What’s Continuous *?
• The Continuous Delivery Pipeline
• Breaking it down
• Putting it together
What is DevOps?
Automation?
Cloud?
Smaller and faster
releases?
Devs who do Ops?
Ops who do dev?
2 pizza
teams?
Culture
Just a buzzword
Just a title
What is DevOps?
• A methodology that promotes collaboration and
coordination between Dev and Ops teams to deliver
products or services in a continuous manner.
• A combination of Culture, Process, and Tools.
• Doesn’t concern just Dev and Ops – all the way from the
ground up
The DevOps “journey”
Continous
Integration
Continuous
Delivery
Continuous
Deployment
Continuous Integration
Code Build Test
• Ways of working & managing work in progress – Agile
[Scrum/Kanban]
• Source code management [Git/SVN] * including
infrastructure-as-code
• Build Automation
• Artifact Management
• Test Automation * yes, including infrastructure-as-code
Let’s talk Infrastructure as Code
(IaC)  Treat as you would Application
Code
 Source control, unit testing,
etc.
 Certain design patterns are
applicable -
decomposition/composition
 Design with the pipeline in
mind
 A good branching strategy
(ideally must match your app
branching)
ARM Templates – (PS) Test-
AzureRmResourceGroupDeployment
AWS CloudFormation – (CLI) aws
cloudformation validate-template
Powershell DSC – Pester
Ruby/Ruby DSL-based – Provided
by vendor (Chef/puppet)
Dockerfiles – orchestrator specific
(use rSpec/ServerSpec to test
dockerfiles)
Testing your
infrastructure code
Continuous Integration Workflow
Continuous
Integration Demo
Let’s take a look at the Git repo
ARM
templatesPowershell
DSC*****
Nuget Package Management
StuffHelper scripts
App Source Code (.NET core 1.1
MVC)
Continuous Delivery
Provision Deploy
• The practice of testing and releasing builds in an automated
fashion, ensuring it is ”production-ready”
• Provision & configure environments in an idempotent
fashion
• Configure and release application code artifacts in a secure,
automated mannerIdempotence - is the property of certain, that can be applied multiple times without changing the result beyond the initial
application
Continuous Delivery Workflow
Continuous Deployment
• Is the seamless ”switch” from the previous version of your
application to the new version as soon as a new build is
“delivered” e.g. cut-over
• Perform this in an automated, but quality-gated process
Continuous Deployment Strategies
In-place
• Update your
existing app
instances
• Also known as
“rolling
updates”
Blue-Green
• Gradually
replace
existing
instances
(Blue) with
new ones
(Green)
Red-Black
• Cut over from
the old set of
instances to
an entirely
new set of
instances
v1.0
v 1.1
v1.0
v1.0
v1.1 v1.0 v1.1
The Continuous Delivery Pipeline
Code Build Test Provision Deploy
Azure Resource
Manager
VM ScaleSets
PowerShell DSC
Let’s talk immutable infrastructure
Define Immutable:
ɪˈmjuːtəb(ə)l/
adjective
unchanging over time or unable to be
changed.
Considerations:
• Application config must be defined in release/run time
• Requires blue/green release capability
• Move away from dedicated “environments” (dedicated
dev, uat, staging)
• Might require some custom engineering with
loadbalancers (ELB, AzureAppGw, Traffic Manager)
• Say goodbye to RDP/SSH
ARM Templates
• Stack template (master template, linked to
vmfactory-vmss.json)
• VM ScaleSets (with Powershell DSC
extension)
• Test your templates! (Test-
AzureRMResourceGroupDeployment)
Techniques used:
• Link templates
• “Property bagging”
• Conditional variables
Nuget Server/Package
Management• Stores, describes, application packages
• Packages are immutable
• Authenticate using a ”Personal Access Token”
• Use vsts/build your own nuget server
Powershell DSC
• Two schools of thought for
instance/configuration management:
• Image-baking (use AzurRM.Compute/images
or OSS tools like Packer by Hashicorp)
• Agent-based config mgmt (Chef, Puppet,
DSC)
VSTS Release Management
• Technically, a glorified task
runner
• Other options:
• Jenkins (OSS)
• TeamCity
• Octopus Deploy
(proudly made by ex-
Readifarians)
• Build once, release
multiple times
• Don’t hardcode
variables/entries – use
tokenisation tasks or
CMDB (Azure Keyvault,
Consul by hashicorp)
Putting it all together
Continuous Delivery
Demo
One more thing….
Let’s release to a Kubernetes cluster..
• Kubernetes – one of the container orchestrator
tools out there (imo the best out there, good job
Google)
• Some kinks to put into a CI/CD pipeline
(especially if using VSTS)
• Azure Container Service is awesome.
Git Clone!
Github repo:
https://github.com/justinbarias/ExpertsLiveRepo
Thank You
www.expertslive.org.au
#expertsliveau

ExpertsLive Session Deck

  • 1.
    Continuous Delivery with VisualStudio Team Services, Azure Resource Manager, Azure VM ScaleSets, and Powershell DSC Justin Barias Readify
  • 2.
    Agenda • Brief primeron DevOps • What’s Continuous *? • The Continuous Delivery Pipeline • Breaking it down • Putting it together
  • 3.
    What is DevOps? Automation? Cloud? Smallerand faster releases? Devs who do Ops? Ops who do dev? 2 pizza teams? Culture Just a buzzword Just a title
  • 4.
    What is DevOps? •A methodology that promotes collaboration and coordination between Dev and Ops teams to deliver products or services in a continuous manner. • A combination of Culture, Process, and Tools. • Doesn’t concern just Dev and Ops – all the way from the ground up
  • 5.
  • 6.
    Continuous Integration Code BuildTest • Ways of working & managing work in progress – Agile [Scrum/Kanban] • Source code management [Git/SVN] * including infrastructure-as-code • Build Automation • Artifact Management • Test Automation * yes, including infrastructure-as-code
  • 7.
    Let’s talk Infrastructureas Code (IaC)  Treat as you would Application Code  Source control, unit testing, etc.  Certain design patterns are applicable - decomposition/composition  Design with the pipeline in mind  A good branching strategy (ideally must match your app branching)
  • 8.
    ARM Templates –(PS) Test- AzureRmResourceGroupDeployment AWS CloudFormation – (CLI) aws cloudformation validate-template Powershell DSC – Pester Ruby/Ruby DSL-based – Provided by vendor (Chef/puppet) Dockerfiles – orchestrator specific (use rSpec/ServerSpec to test dockerfiles) Testing your infrastructure code
  • 9.
  • 10.
  • 11.
    Let’s take alook at the Git repo ARM templatesPowershell DSC***** Nuget Package Management StuffHelper scripts App Source Code (.NET core 1.1 MVC)
  • 12.
    Continuous Delivery Provision Deploy •The practice of testing and releasing builds in an automated fashion, ensuring it is ”production-ready” • Provision & configure environments in an idempotent fashion • Configure and release application code artifacts in a secure, automated mannerIdempotence - is the property of certain, that can be applied multiple times without changing the result beyond the initial application
  • 13.
  • 14.
    Continuous Deployment • Isthe seamless ”switch” from the previous version of your application to the new version as soon as a new build is “delivered” e.g. cut-over • Perform this in an automated, but quality-gated process
  • 15.
    Continuous Deployment Strategies In-place •Update your existing app instances • Also known as “rolling updates” Blue-Green • Gradually replace existing instances (Blue) with new ones (Green) Red-Black • Cut over from the old set of instances to an entirely new set of instances v1.0 v 1.1 v1.0 v1.0 v1.1 v1.0 v1.1
  • 16.
    The Continuous DeliveryPipeline Code Build Test Provision Deploy Azure Resource Manager VM ScaleSets PowerShell DSC
  • 17.
    Let’s talk immutableinfrastructure Define Immutable: ɪˈmjuːtəb(ə)l/ adjective unchanging over time or unable to be changed. Considerations: • Application config must be defined in release/run time • Requires blue/green release capability • Move away from dedicated “environments” (dedicated dev, uat, staging) • Might require some custom engineering with loadbalancers (ELB, AzureAppGw, Traffic Manager) • Say goodbye to RDP/SSH
  • 18.
    ARM Templates • Stacktemplate (master template, linked to vmfactory-vmss.json) • VM ScaleSets (with Powershell DSC extension) • Test your templates! (Test- AzureRMResourceGroupDeployment) Techniques used: • Link templates • “Property bagging” • Conditional variables
  • 19.
    Nuget Server/Package Management• Stores,describes, application packages • Packages are immutable • Authenticate using a ”Personal Access Token” • Use vsts/build your own nuget server
  • 20.
    Powershell DSC • Twoschools of thought for instance/configuration management: • Image-baking (use AzurRM.Compute/images or OSS tools like Packer by Hashicorp) • Agent-based config mgmt (Chef, Puppet, DSC)
  • 21.
    VSTS Release Management •Technically, a glorified task runner • Other options: • Jenkins (OSS) • TeamCity • Octopus Deploy (proudly made by ex- Readifarians) • Build once, release multiple times • Don’t hardcode variables/entries – use tokenisation tasks or CMDB (Azure Keyvault, Consul by hashicorp)
  • 22.
  • 23.
  • 24.
  • 25.
    Let’s release toa Kubernetes cluster.. • Kubernetes – one of the container orchestrator tools out there (imo the best out there, good job Google) • Some kinks to put into a CI/CD pipeline (especially if using VSTS) • Azure Container Service is awesome.
  • 26.
  • 27.

Editor's Notes

  • #2 Introduce myself been in australia for 1 year, worked across multiple domains across infrastructure & ops Doing DevOps for 2 years
  • #3 Reference site reliability engineering Demos will be time sensitive Take away is not to be a master of each component of the pipeline but rather to see the bigger story And to make DevOps "real"
  • #4 Tell a story on how I got into DevOps (AWS interview story) Joke on pizza Call out agile practitioners DevOps not exclusive to cloud
  • #5 Huge releases is the source/origin of maintenance windows/down time Huge part is culture, allergy to change Pathlogical, bureaucratic organisations
  • #7 Analogy with manufacturing Comparison with waterfall
  • #8 Dockerfiles? Who has worked /played around with docker?
  • #11 Demo VSTS Change application code slightly – branch, tag, commit Show VSTS Build, show continuous integration settings Show output of build Describe GitVersion (what it does)
  • #12 Show what the website looks like on my machine
  • #13 Example of dog feeding vs dog bathing
  • #14 Normally stops at functional tests
  • #15 Example - facebook
  • #16 Red-black is highest degree of reliability
  • #17 Kick off a release from this point, will take a while
  • #18 Break-glass scenario