Azure arm templates

sachinkalia15 87 views 14 slides Dec 28, 2019
Slide 1
Slide 1 of 14
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14

About This Presentation

These slides elaborates about ARM templates and how can we utilize ARM templates to provision resource with in AZURE


Slide Content

Azure Infra Structure as Code( IaC ) Sachin Kalia  1 @dotnetpiper  

Azure ARM Agenda What is Azure Resource Manager Understanding ARM Templates Deploying simple PaaS based ARM Templates Nested Templates Templates Scopes Activity Alerts enabling through ARM Demonstration

Azure infrastructure as code Azure Resource Manager - is a consistent management layer which allows to work with separate resources as a group, in a single, coordinated operation. Background Azure Resource Manager, or ARM, is the primary deployment type for Azure Replaces the classic Azure Service Manager (ASM) model; aka “Azure v1” Used across cloud environments, including: Public (Azure), Sovereign (Gov Cloud), and Private (Azure Stack) The ARM model lets you state "Here is what I intend to create" without having to write the sequence of programming commands to create it. Azure Resource Manager template - A JavaScript Object Notation (JSON) file that defines one or more resources to deploy to a resource group. It also defines the dependencies between the deployed resources. The template can be used to deploy the resources consistently and repeatedly.

Azure ARM Azure Agenda How does Azure Resource Manager work?

Azure infrastructure as code ( IaC ) Understanding ARM Template

ARM Template Tools we can use Visual Studio Visual Studio Code Terraform, Azure Building Blocks, Ansible, etc. Configuration via Azure Automation DSC (aka PowerShell DSC), IaaS VM Custom Script Extension, Puppet, Chef, Salt Stack Visualize with ARMViz NotePad ++

ARM Template Core Structure { "$schema" : "https://schema.management.azure.com/schemas/2015-01-01/ deploymentTemplate.json #" , "contentVersion" : "1.0.0.0" , "parameters" : {}, "variables" : {}, "resources" : [], "outputs" : {} }

ARM Template Core Structure The allowed types for values are: String or secureString – any valid JSON string int – any valid JSON integer bool – any valid JSON Boolean object – any valid JSON object array – any valid JSON array

ARM Template Parameters "parameters" : { " storageAccountType " : { "type" : "string" , " defaultValue " : " Standard_LRS " , " allowedValues " : [ " Standard_LR S " , " Standard_GRS " , " Standard_ZRS " , " Premium_LRS " ], "metadata" : { "description" : "Storage Account type" } } , " storageAccountName " : { "type" : "string" , " defaultValue " : "azureglobalbootcamp2018" , " maxlength " : 24 , "metadata" : { " description" : "The name of the Storage Account" } } In the parameters section of the template, you specify which values you can input when deploying the resources

ARM Template Parameters file { "$schema": " http://schema.management.azure.com/schemas/201501-01/ deploymentParameters.json #", "contentVersion": "1.0.0.0", "parameters": { “ winServerEdition ": { "value": “2012-R2-Datacenter" }, " adminUsername ": { "value": “ vmAdmin " } } } In the parameters section of the template, you specify which values you can input when deploying the resources

ARM Template variable "variables": { " storageName ":"[ concat ( toLower (parameters(‘prefix’)), resourceGroup ().id)]“, " environmentSettings ": { "test": { " instanceSize ": "Small", " instanceCount ": 1 }, "prod": { " instanceSize ": "Large", " instanceCount ": 4 } } } In the variables section, you construct values that can be used throughout your template.

Azure infrastructure as code ( IaC ) Used across Public (Azure), Sovereign (Gov Cloud), and Private (Azure Stack) Obtain more granularity, tagging, RBAC Repeatable, templated deployments (including dependencies) Remember the Best Practices Metadata Descriptive Names pascalCasing Impose restrictions (i.e. MinLength , AllowedValues , etc.) Use Variables Do not store sensitive information in the parameters file (i.e. the Local Admin password)

DEMOS Simple ARM template deployment with PowerShell Azure Quick Start Gallery How to extract ARM template of existing resources Adding a Template directly from Azure Portal

Thanks www.dotnetpiper.com  14 @dotnetpiper