Infrastructure as Code
with Azure
Daron Yöndem
http://daron.me | @daronyondem
Slide 2
Slide 2 text
DEMO
ARM Templates
Slide 3
Slide 3 text
No content
Slide 4
Slide 4 text
Build Definition Change
Slide 5
Slide 5 text
Release Definition Change
Slide 6
Slide 6 text
No content
Slide 7
Slide 7 text
No content
Slide 8
Slide 8 text
No content
Slide 9
Slide 9 text
DEMO
Azure Portal
Slide 10
Slide 10 text
No content
Slide 11
Slide 11 text
No content
Slide 12
Slide 12 text
No content
Slide 13
Slide 13 text
Insights of an ARM Template
Slide 14
Slide 14 text
No content
Slide 15
Slide 15 text
VSCode Extension
• Ctrl+P > ext install
Slide 16
Slide 16 text
DEMO
Azure CLI
Slide 17
Slide 17 text
Azure Powershell vs CLI
Slide 18
Slide 18 text
No content
Slide 19
Slide 19 text
What is PowerShell DSC
• Is a new configuration management platform. It does not go against
Chef or puppet. It works with them.
• Enables deployment of configuration data.
• Fixes a configuration that has drifted away from the desired state.
Slide 20
Slide 20 text
VM Agents and Extensions
• Azure VM Agent is a secured, light-weight process that runs
extensions.
• VMAccessAgent, DSC, ChefClient, DockerExtension
• Azure Powershell DSC Extension does the job for DSC.
Slide 21
Slide 21 text
Publishing Configuration
• Creates a ZIP File.
• Uploaded to Storage Account
• Set it to the machine.
Slide 22
Slide 22 text
DEMO
Azure Automation DCS
Slide 23
Slide 23 text
No content
Slide 24
Slide 24 text
Import DSC Configuration
Slide 25
Slide 25 text
Compile Configuration
Slide 26
Slide 26 text
Add VM as a Node
Slide 27
Slide 27 text
Onboard any machine!
• https://docs.microsoft.com/en-us/azure/automation/automation-
dsc-onboarding
Slide 28
Slide 28 text
How to write configurations?
• The Configuration block. This is the
outermost script block. You define it by using
the Configuration keyword and providing a
name.
• One or more Node blocks. These define the
nodes (computers or VMs) that you are
configuring. In the above configuration, there
is one Node block that targets a computer
named "TEST-PC1".
• One or more resource blocks. This is where
the configuration sets the properties for the
resources that it is configuring. In this case,
there are two resource blocks, each of which
call the "WindowsFeature" resource.
Slide 29
Slide 29 text
Example setting web server with DSC
Slide 30
Slide 30 text
How to do it with Powershell.
$params = @{
AutomationAccountName = 'daronautomation'
ResourceGroupName = 'Group'
SourcePath = 'C:\NewTestEnvironment.ps1'
Published = $true
Force = $true
}
$null = Import-AzureRmAutomationDscConfiguration $params