What is DevOps
http://www.itproguy.com/devops-practices
Infrastructure as Code
“Infrastructure as code is the approach to
defining computing and network
infrastructure through source code that can
then be treated just like any software
system.”
Martin Fowler
https://martinfowler.com/bliki/InfrastructureAsCode.html
Azure Resource Manager
API ENDPOINT (MANAGEMENT.AZURE.COM)
ACTIVITY LOGS, ACCESS CONTROL, POLICY, LOCKS,
TEMPLATE ENGINE, DEPLOYMENTS, RESOURCE GROUP
PROVIDER CONTRACT (RPC)
RESOURCE
PROVIDERS
Data
Plane
Control
Plane
Clients
The big picture
Demo
AZURE PORTAL
A service that supplies the resources you can
deploy and manage through Resource Manager.
Each resource provider offers operations for
working with the resources that are deployed.
Resource Provider
Resource Providers from PowerShell
a Resource Provider
might be registered
to your subscription
Imperative
v.s.
Declarative
Imperative Declarative
vs
Example: creating a Storage Account
PowerShell
Az Cli 2.0
Terraform
Empty ARM Template
Example: creating a Storage Account (cont.)
ARM Template
How to deploy an ARM template
PowerShell
Az Cli 2.0
One more (imperative) example:
How to develop an ARM template
Visual Studio Code Visual Studio Azure Portal
Quickstarts
templates
on GitHub
Visualize ARM
templates on
armviz.io
How to test an ARM template
https://blog.mexia.com.au/testing-arm-templates-with-pester
https://blogs.technet.microsoft.com/stefan_stranger/2017/08/02/testing-
azure-resource-manager-template-functions/
Some more examples:
template1a.json
template1b.json
template1c.json
template1.json
A template can reference
other templates
template1.json
You can split a template into different
(cross-dependent) templates
template1a.json template1b.json
= +
Simplified json
with Azure
building blocks
https://github.com/mspnp/template-building-blocks/wiki
Simplified json with building blocks
This example does the following:
• Deploys 3 VMs in an Availability Set
• Enables diagnostics
• Uses managed OS Disks
• Uses Windows Server 2016
• Creates Public IP for each VM
Configuration Management
(Automation)
VM Extensions for Configuration Management
CHEF
PUPPET
Custom Script
PowerShell DSC
Example: PowerShell DSC Configuration
Example
DSC Extension
for Linux in
ARM Template
Example
Custom script
extension
(Linux)
cat script.sh | base64 -w0
Embedding a script in the template
https://open.microsoft.com/2018/05/23/immutable-infrastructure-azure-vsts-terraform-packer-ansible/
Building an immutable
infrastructure with VSTS,
Terraform, Packer and
Ansible
Multi-environment
Templates
List of possible enviroments
Each environment
has the same set of
properties
How to handle
multiple
environments
in the same
template
testvm1-nic,
testvm2-nic,
…
Get the first usable IP in the
subnet (i.e. 10.25.60.36)
10.25.6011
8
11 – (8+1) = 29
32
35
10.25.60.36, 10.25.60.37, ….
•User defined functions in templates
•Subscription based deployments
 Deploy subscription-level resources
 Role definitions
 Role assignments
•Rollback
 To previous deployment on fail
(Next) improvements in ARM Templates
ARM Template
Terraform
OSS RP
Resource
• As an ARM resource
• Sign up for private preview:
https://aka.ms/tfossrp
Terraform config
TF Azure
Resource
TF Azure
module
Make Azure a first class provider in Terraform
• Increased Azure resource coverage
• More TF Azure modules
(Next) Improved Terraform Support
DevOps Books
Thank You

Azure deployments and ARM templates