Azure ARM Templates - 101 CLD321 Aaron Saikovski Microsoft Ignite 2016 12/12/2017 6:34 AM Azure ARM Templates - 101 CLD321 Aaron Saikovski Specialist Solution Architect – Microsoft Cloud Technologies Rackspace Australia © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Agenda Intros History Anatomy Demo – “Hello World” 12/12/2017 6:34 AM Agenda Intros History Anatomy Demo – “Hello World” Building and deploying Tips and Tricks Demo – Deploying a complete stack Questions © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
12/12/2017 6:34 AM About me © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
12/12/2017 6:34 AM Some History © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
History Microsoft Ignite 2016 12/12/2017 6:34 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
12/12/2017 6:34 AM © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Anatomy of an ARM template 12/12/2017 6:34 AM Anatomy of an ARM template © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Blank ARM Template { "$schema": "http://schema.management.azure.com/ 12/12/2017 6:34 AM { "$schema": "http://schema.management.azure.com/ schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "", "parameters": { }, "variables": { }, "resources": [ ], "outputs": { } } © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Blank ARM Template – Parameter File "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>" } © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Demo “HelloWorld” ARM Template Deployment Microsoft Ignite 2016 12/12/2017 6:34 AM Demo “HelloWorld” ARM Template Deployment © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Building and Deploying 12/12/2017 6:34 AM Building and Deploying © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Building your own templates 12/12/2017 6:34 AM 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/ © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Visual Studio Tools JSON Outline view Ready to go templates 12/12/2017 6:34 AM JSON Outline view Ready to go templates © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
It’s free and cross platform! Visual Studio Code 12/12/2017 6:34 AM It’s free and cross platform! © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Building your own templates 12/12/2017 6:34 AM 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 © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Deploying an ARM template via Visual Studio 12/12/2017 6:34 AM © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Recap Lots of samples available Tooling is 1st class Microsoft Ignite 2016 12/12/2017 6:34 AM Recap Lots of samples available Tooling is 1st class Lots of options for deployment Start with existing and modify to suit Incremental deployment model © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
12/12/2017 6:34 AM Tips and Tricks © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Tips and Tricks ARM -> Resource Group ->Resources 12/12/2017 6:34 AM Tips and Tricks ARM -> Resource Group ->Resources Resource Location -> Different to Resource Group Standard Storage -> Premium Keep SDK and tools up to date © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Tips and Tricks..cont Use JSON Lint (http://jsonlint.com/) 12/12/2017 6:34 AM 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 © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Tips and Tricks..cont 12/12/2017 6:34 AM $templateFile = "$basepath\storage-account\storageaccount.json" $params = @{storageAccountType="Standard_LRS";storageAccountCount=1;storageAccountSuffix="ign";environment="Test";buildDate="04/01/2017";buildBy="AaronS"} New-AzureRmResourceGroupDeployment -Name ((Get-ChildItem $templateFile).BaseName + '-' + ((Get-Date).ToUniversalTime()).ToString('MMdd-HHmm')) ` -ResourceGroupName $ResourceGroupName ` -TemplateFile $templateFile ` -TemplateParameterObject $params ` -Force © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Useful Links Visual Studio Code - https://code.visualstudio.com/ 12/12/2017 6:34 AM 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 © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Recap Resources deployed to different region than Resource Group Microsoft Ignite 2016 12/12/2017 6:34 AM Recap Resources deployed to different region than Resource Group Keep tools up to date JSONLint fix JSON syntax -TemplateParameterObject via PowerShell © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Demo Building a complete stack Microsoft Ignite 2016 12/12/2017 6:34 AM Demo Building a complete stack © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Demo – Deploy a Single VM 12/12/2017 6:34 AM © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Recap Layered ARM Deployment Simple VM Deployment Microsoft Ignite 2016 12/12/2017 6:34 AM Recap Layered ARM Deployment Simple VM Deployment Incremental ARM Model Mix of Visual Studio and PowerShell Change VM Size via ARM Resource dependencies © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Session Recap Intros History Anatomy Demo – “Hello World” 12/12/2017 6:34 AM Session Recap Intros History Anatomy Demo – “Hello World” Building and deploying Tips and Tricks Demo – Deploying a complete stack © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Questions Microsoft Ignite 2016 12/12/2017 6:34 AM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Continue your Ignite learning path 12/12/2017 6:34 AM Continue your Ignite learning path 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 © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Win a Spark After Dark drone pilot pass by completing your session evaluation ASAP #MSAUIGNITE
12/12/2017 6:34 AM Thank you Chat with me in the Speaker Lounge Find me (@RuskyDuck72 or email: aaron.saikovski@rackspace.com) or at the Rackspace booth © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.