Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
CLD321
Aaron Saikovski
Specialist Solution Architect – Microsoft Cloud Technologies
Rackspace Australia
T: @RuskyDuck72 E: aaron.saikovski@rackspace.com
Azure ARM Templates - 101
Agenda
About me
Azure ARM Templates 101
Azure ARM Templates 101
Azure ARM Templates 101
Azure ARM Templates 101
{
"$schema":
"http://schema.management.azure.com/
schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "",
"parameters": { },
"variables": { },
"resources": [ ],
"outputs": { }
}
"parameters": {
"<parameter-name>" : {
"type" : "<type-of-parameter-value>",
"defaultValue": "<default-value-of-parameter>",
"allowedValues": [ "<array-of-allowed-values>" ],
"minValue": <minimum-value-for-int>,
"maxValue": <maximum-value-for-int>,
"minLength": <minimum-length-for-string-or-array>,
"maxLength": <maximum-length-for-string-or-array-
parameters>,
"metadata": {
"description": "<description-of-the parameter>"
}
}
Azure ARM Templates 101
Azure ARM Templates 101
Building your own templates
Active Online community
Shared repositories -> GitHub, Quickstart
Visual Studio tools help get you started
Seek out an expert at Microsoft Ignite 2017 
Useful Links:
https://github.com/Azure/azure-quickstart-templates
https://azure.microsoft.com/en-us/resources/templates/
Azure ARM Templates 101
Visual Studio Tools
Visual Studio Code
It’s free and cross platform!
Building your own templates
ARM templates -> deploy -> redeploy
Source control and versioning
Deploy via Visual Studio or via PowerShell
New-AzureRmResourceGroupDeployment
-Name ((Get-ChildItem $templateFile).BaseName + '-' +
((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm'))
-ResourceGroupName $ResourceGroupName
-TemplateFile $templateFile
-TemplateParameterFile $parametersFile
Deploying an ARM template via Visual Studio
Recap
Lots of samples available
Tooling is 1st class
Lots of options for deployment
Start with existing and modify to suit
Incremental deployment model
Azure ARM Templates 101
Tips and Tricks
ARM -> Resource Group ->Resources
Resource Location -> Different to Resource Group
Standard Storage -> Premium
Keep SDK and tools up to date
Tips and Tricks..cont
Use JSON Lint (http://jsonlint.com/)
Layer templates
Set correct subscription
$activesub = Get-AzureRmSubscription -
SubscriptionId 'XXX-XXX-XXX-XXX'
-TenantId 'XXX-XXX-XXX-XXX'
$activesub | Set-AzureRmContext
Tips and Tricks..cont
$templateFile = "$basepathstorage-
accountstorageaccount.json"
$params =
@{storageAccountType="Standard_LRS";storageAccountCount=1;stor
ageAccountSuffix="ign";environment="Test";buildDate="04/01/201
7";buildBy="AaronS"}
New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem
$templateFile).BaseName + '-' + ((Get-
Date).ToUniversalTime()).ToString('MMdd-HHmm')) `
-ResourceGroupName $ResourceGroupName `
-TemplateFile $templateFile `
-TemplateParameterObject $params `
-Force
Useful Links
Visual Studio Code - https://code.visualstudio.com/
Git Extensions - https://gitextensions.github.io/
Azure Storage Explorer: http://storageexplorer.com/
Azure Resource Explorer: https://resources.azure.com/
Azure Quickstart Templates: http://bit.ly/1IJvrkQ
Best Practices Guide: http://bit.ly/2jGSEjg
ARM Authoring Guide: http://bit.ly/2jGPqwc
Recap
Resources deployed to different region than Resource
Group
Keep tools up to date
JSONLint fix JSON syntax
-TemplateParameterObject via PowerShell
Azure ARM Templates 101
Demo – Deploy a Single VM
Recap
Layered ARM Deployment
Simple VM Deployment
Incremental ARM Model
Mix of Visual Studio and PowerShell
Change VM Size via ARM
Resource dependencies
Session Recap
Azure ARM Templates 101
Complete your session evaluation on MyIgnite
for your chance to WIN one of many daily prizes.
(image of prizes tbc)
Session evaluation
Visit Channel 9 to access a wide range of Microsoft training
and event recordings https://channel9.msdn.com/
Head to the TechNet Eval Centre to download trials of the latest
Microsoft products http://Microsoft.com/en-us/evalcenter/
Visit Microsoft Virtual Academy for free online training visit
https://www.microsoftvirtualacademy.com
Continue your Ignite learning path
CLD321
Aaron Saikovski
Specialist Solution Architect – Microsoft Cloud Technologies
Rackspace Australia
T: @RuskyDuck72 E: aaron.saikovski@rackspace.com
Azure ARM Templates - 101
Microsoft Ignite

More Related Content

Azure ARM Templates 101

  • 1. CLD321 Aaron Saikovski Specialist Solution Architect – Microsoft Cloud Technologies Rackspace Australia T: @RuskyDuck72 E: aaron.saikovski@rackspace.com Azure ARM Templates - 101
  • 9. "parameters": { "<parameter-name>" : { "type" : "<type-of-parameter-value>", "defaultValue": "<default-value-of-parameter>", "allowedValues": [ "<array-of-allowed-values>" ], "minValue": <minimum-value-for-int>, "maxValue": <maximum-value-for-int>, "minLength": <minimum-length-for-string-or-array>, "maxLength": <maximum-length-for-string-or-array- parameters>, "metadata": { "description": "<description-of-the parameter>" } }
  • 12. Building your own templates Active Online community Shared repositories -> GitHub, Quickstart Visual Studio tools help get you started Seek out an expert at Microsoft Ignite 2017  Useful Links: https://github.com/Azure/azure-quickstart-templates https://azure.microsoft.com/en-us/resources/templates/
  • 15. Visual Studio Code It’s free and cross platform!
  • 16. Building your own templates ARM templates -> deploy -> redeploy Source control and versioning Deploy via Visual Studio or via PowerShell New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $templateFile).BaseName + '-' + ((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm')) -ResourceGroupName $ResourceGroupName -TemplateFile $templateFile -TemplateParameterFile $parametersFile
  • 17. Deploying an ARM template via Visual Studio
  • 18. Recap Lots of samples available Tooling is 1st class Lots of options for deployment Start with existing and modify to suit Incremental deployment model
  • 20. Tips and Tricks ARM -> Resource Group ->Resources Resource Location -> Different to Resource Group Standard Storage -> Premium Keep SDK and tools up to date
  • 21. Tips and Tricks..cont Use JSON Lint (http://jsonlint.com/) Layer templates Set correct subscription $activesub = Get-AzureRmSubscription - SubscriptionId 'XXX-XXX-XXX-XXX' -TenantId 'XXX-XXX-XXX-XXX' $activesub | Set-AzureRmContext
  • 22. Tips and Tricks..cont $templateFile = "$basepathstorage- accountstorageaccount.json" $params = @{storageAccountType="Standard_LRS";storageAccountCount=1;stor ageAccountSuffix="ign";environment="Test";buildDate="04/01/201 7";buildBy="AaronS"} New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $templateFile).BaseName + '-' + ((Get- Date).ToUniversalTime()).ToString('MMdd-HHmm')) ` -ResourceGroupName $ResourceGroupName ` -TemplateFile $templateFile ` -TemplateParameterObject $params ` -Force
  • 23. Useful Links Visual Studio Code - https://code.visualstudio.com/ Git Extensions - https://gitextensions.github.io/ Azure Storage Explorer: http://storageexplorer.com/ Azure Resource Explorer: https://resources.azure.com/ Azure Quickstart Templates: http://bit.ly/1IJvrkQ Best Practices Guide: http://bit.ly/2jGSEjg ARM Authoring Guide: http://bit.ly/2jGPqwc
  • 24. Recap Resources deployed to different region than Resource Group Keep tools up to date JSONLint fix JSON syntax -TemplateParameterObject via PowerShell
  • 26. Demo – Deploy a Single VM
  • 27. Recap Layered ARM Deployment Simple VM Deployment Incremental ARM Model Mix of Visual Studio and PowerShell Change VM Size via ARM Resource dependencies
  • 30. Complete your session evaluation on MyIgnite for your chance to WIN one of many daily prizes. (image of prizes tbc) Session evaluation
  • 31. Visit Channel 9 to access a wide range of Microsoft training and event recordings https://channel9.msdn.com/ Head to the TechNet Eval Centre to download trials of the latest Microsoft products http://Microsoft.com/en-us/evalcenter/ Visit Microsoft Virtual Academy for free online training visit https://www.microsoftvirtualacademy.com Continue your Ignite learning path
  • 32. CLD321 Aaron Saikovski Specialist Solution Architect – Microsoft Cloud Technologies Rackspace Australia T: @RuskyDuck72 E: aaron.saikovski@rackspace.com Azure ARM Templates - 101