SlideShare uma empresa Scribd logo
1 de 18
Azure Resource Manager (ARM) Template
A Beginner Guide for Developers
Juv Chan @juvchan juvchan@hotmail.com
Senior Azure Developer
https://www.linkedin.com/in/juv-chan-6104a540
https://github.com/juvchan
http://stackoverflow.com/users/3203213/juvchan
Agenda
• Personal & Professional Background
• ARM Overview
• ARM Template Basics
• ARM Template Usage - Practical Scenarios Demo
• ARM Template Authoring Best Practice
• Known Issues / Limitations
• ARM Template Troubleshooting Tips
• Graduated with a B.ENG. (Computer) Honors degree from the School of Computer
Engineering, Nanyang Technological University some years back…
• Study & Work in Singapore for 8 year
• 2 years of professional hands-on development experience on the Microsoft Azure platform &
services.
(Azure App Service Web App, Azure Resource Manager Template, Azure PowerShell, Azure SQL Database,
Azure Storage Blob, Azure Storage Table, Azure Traffic Manager, Azure HDInsight, Azure Virtual Machine,
Azure Active Directory etc. )
• Working closely with the Azure Product Development team based in Redmond, Seattle
Background
• 3 technical videos on Azure Development & Big Data Analytics featured on Microsoft’s
Channel 9 website.
• URL: https://channel9.msdn.com/Events/Speakers/juv-chan
• Interactive IIS Log Analysis with Azure HDInsight Spark (Linux)
• Azure Resource Management (ARM) .NET SDK - A Hands-on Beginner Guide
• Azure Web App Management .NET SDK - A Hands-on Guide
Technical Videos Featured on CH9
Azure Resource Manager (ARM) Overview
• Application depend on Infrastructure resources,
e.g. Virtual Machine, Web Server, Database, Storage, Virtual Network etc.
• Traditionally, these resources are viewed as separate, independent entities
E.g. Affinity Group in Azure Service Management (Classic)
• Azure Resource Manager (ARM) Key Concepts:
 Resource Group
 Resource Providers
 Template Deployment
 Tags
 Access Control
• Backbone of Azure Infrastructure As A Service (IaaS)
Azure Resource Manager (ARM) Overview
• Resource Group
Container for a set of resources for an application
• Resource Provider
Service Provider that supplies the resources that can be deployed and managed
through ARM
E.g. Microsoft.Web, Microsoft.Storage, Microsoft.Compute, Microsoft.Network
• Template Deployment
ARM Template (JSON format) defines the infrastructure for your app, how to
configure the infrastructure, and how to publish your app code to that infrastructure
Azure Resource Manager (ARM) Overview
• Tags
Tagging feature enables you to categorize resources based on requirements
• Access Control
Using Role-Based Access Control (RBAC) to control access to resources
Roles: Owner, Reader, Contributor
• REST APIs
Relying on REST APIs to perform create, read, update, delete (CRUD) operations
on resources
ARM Template Basics
• Define the resources that are needed for the application and specify
deployment parameters to input values for different environments.
• Deploys and provisions all of the resources for your application in a single,
coordinated operation
• JSON format
• Infrastructure As Code
• Single Template File (xxx.template.json) +
Single Template Parameter File (xxx.param.json)
ARM Template Basic Format
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "",
"parameters": { },
"variables": { },
"resources": [ ],
"outputs": { }
}
ARM Template Parameter Basic Format
"parameters": {
"<parameterName>" :
{ "type" : "<type-of-parameter-value>",
"defaultValue": "<optional-default-value-of-parameter>",
"allowedValues": [ "<optional-array-of-allowed-values>" ],
"minValue": <optional-minimum-value-for-int-parameters>,
"maxValue": <optional-maximum-value-for-int-parameters>,
"minLength": <optional-minimum-length-for-string-secureString-array-parameters>,
"maxLength": <optional-maximum-length-for-string-secureString-array-parameters>,
"metadata": { "description": "<optional-description-of-the parameter>" } } }
These parameter values enable you to customize the deployment by providing values
that are tailored for a particular environment (such as dev, test, and production).
You do not have to provide parameters in your template, but without parameters your
template would always deploy the same resources with the same names, locations, and
properties.
Plan Your Template
Before getting started with the template, you should take some time to figure out
what you wish to deploy and how you will use the template.
Key points to consider:
• Which resources types you need to deploy?
• Where those resources will reside?
• Which version of the resource provider API you will use?
• Whether any of the resources must be deployed after other resources?
• Which values you want to pass in during deployment, and which values you
want to define directly in the template?
• Whether you need to return values from the deployment?
Ways to deploy ARM Template
• Azure Portal
• Azure PowerShell
• Azure CLI (Cross-Platform Command Line Interface)
• Azure SDK (.NET, Java, Python, Node.js, Ruby)
ARM Template Usage - Practical Scenarios Demo
ARM Template Authoring Best Practice
• Visual Studio 2015 is the best authoring tool for ARM Template!
• Define Api Versions for different Resource Providers as variables
instead of parameters. Much easier to find and replace.
• Use ARM Template expression function such as trim(), toLower() as a
data cleaning measure to ensure input consistency
• Azure Quick Start Template (GitHub)
• Azure Resource Manager Schema (GitHub) to get the latest Api Version
for the resource providers you’re going to use
Known Issues/Limitations
• ARM Template File Size limit = 1 MB
• ARM Template Parameter File Size = 64 KB
• If parameter name value contains “.” character, the ARM template
deployment will fail in Azure portal (bug)
• E.g. “My.Database”
• Variables does not support ARM template expression function such as
“reference()”
ARM Template Troubleshooting Tips
• Azure Resource Explorer
https://resources.azure.com/
• Azure Audit Log
• Azure Quick Start Templates (GitHub)
• Azure Resource Manager Schema (GitHub)
• Stack Overflow / MSDN Forums
• Azure Resource Manager Overview
https://azure.microsoft.com/en-us/documentation/articles/resource-group-overview/
• Azure Quickstart Templates
https://azure.microsoft.com/en-us/documentation/templates/
• Azure Resource Manager providers, regions, API versions and schemas
https://azure.microsoft.com/en-us/documentation/articles/resource-manager-supported-services/
• Azure Resource Manager Schema
https://github.com/Azure/azure-resource-manager-schemas
• Azure Resource Manager REST API Reference
https://msdn.microsoft.com/en-us/library/azure/dn790568.aspx
• Authoring Azure Resource Manager templates
https://azure.microsoft.com/en-us/documentation/articles/resource-group-authoring-templates/
Useful Resources & References
Thank You!

Mais conteúdo relacionado

Mais procurados

Development and Test on AWS - Pizette
Development and Test on AWS - PizetteDevelopment and Test on AWS - Pizette
Development and Test on AWS - Pizette
Amazon Web Services
 
AWS - Migrating Internal IT Applications
AWS - Migrating Internal IT Applications AWS - Migrating Internal IT Applications
AWS - Migrating Internal IT Applications
Amazon Web Services
 

Mais procurados (20)

Building infrastructure with Azure Resource Manager using PowerShell
Building infrastructure with Azure Resource Manager using PowerShell Building infrastructure with Azure Resource Manager using PowerShell
Building infrastructure with Azure Resource Manager using PowerShell
 
Microsoft Azure essentials
Microsoft Azure essentialsMicrosoft Azure essentials
Microsoft Azure essentials
 
Automating Your Azure Environment
Automating Your Azure EnvironmentAutomating Your Azure Environment
Automating Your Azure Environment
 
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar SeriesImproving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
Improving Infrastructure Governance on AWS - AWS June 2016 Webinar Series
 
AWS Tips for LAUNCHing Your Infrastructure in the Cloud
AWS Tips for LAUNCHing Your Infrastructure in the CloudAWS Tips for LAUNCHing Your Infrastructure in the Cloud
AWS Tips for LAUNCHing Your Infrastructure in the Cloud
 
Infrastructure as Code for Beginners
Infrastructure as Code for BeginnersInfrastructure as Code for Beginners
Infrastructure as Code for Beginners
 
IaC로 AWS인프라 관리하기 - 이진성 (AUSG) :: AWS Community Day Online 2021
IaC로 AWS인프라 관리하기 - 이진성 (AUSG) :: AWS Community Day Online 2021IaC로 AWS인프라 관리하기 - 이진성 (AUSG) :: AWS Community Day Online 2021
IaC로 AWS인프라 관리하기 - 이진성 (AUSG) :: AWS Community Day Online 2021
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
Security Day IAM Recommended Practices
Security Day IAM Recommended PracticesSecurity Day IAM Recommended Practices
Security Day IAM Recommended Practices
 
(SOV204) Scaling Up to Your First 10 Million Users | AWS re:Invent 2014
(SOV204) Scaling Up to Your First 10 Million Users | AWS re:Invent 2014(SOV204) Scaling Up to Your First 10 Million Users | AWS re:Invent 2014
(SOV204) Scaling Up to Your First 10 Million Users | AWS re:Invent 2014
 
Development and Test on AWS - Pizette
Development and Test on AWS - PizetteDevelopment and Test on AWS - Pizette
Development and Test on AWS - Pizette
 
Monitoring Containers at Scale - September Webinar Series
Monitoring Containers at Scale - September Webinar SeriesMonitoring Containers at Scale - September Webinar Series
Monitoring Containers at Scale - September Webinar Series
 
Programando sua infraestrutura com o AWS CloudFormation
Programando sua infraestrutura com o AWS CloudFormationProgramando sua infraestrutura com o AWS CloudFormation
Programando sua infraestrutura com o AWS CloudFormation
 
AWS OpsWorks for Chef Automate
AWS OpsWorks for Chef AutomateAWS OpsWorks for Chef Automate
AWS OpsWorks for Chef Automate
 
AWS - Migrating Internal IT Applications
AWS - Migrating Internal IT Applications AWS - Migrating Internal IT Applications
AWS - Migrating Internal IT Applications
 
Infrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormationInfrastructure Continuous Delivery Using AWS CloudFormation
Infrastructure Continuous Delivery Using AWS CloudFormation
 
Continuous Deployment Practices, with Production, Test and Development Enviro...
Continuous Deployment Practices, with Production, Test and Development Enviro...Continuous Deployment Practices, with Production, Test and Development Enviro...
Continuous Deployment Practices, with Production, Test and Development Enviro...
 
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
Managing Your Infrastructure as Code by Travis Williams, Solutions Architect,...
 
AWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar SeriesAWS Infrastructure as Code - September 2016 Webinar Series
AWS Infrastructure as Code - September 2016 Webinar Series
 
Top 10 AWS Identity and Access Management (IAM) Best Practices (SEC301) | AWS...
Top 10 AWS Identity and Access Management (IAM) Best Practices (SEC301) | AWS...Top 10 AWS Identity and Access Management (IAM) Best Practices (SEC301) | AWS...
Top 10 AWS Identity and Access Management (IAM) Best Practices (SEC301) | AWS...
 

Semelhante a Azure Resource Manager (ARM) Template - A Beginner Guide for Developers

JavaScript MVC Frameworks: Backbone, Ember and Angular JS
JavaScript MVC Frameworks: Backbone, Ember and Angular JSJavaScript MVC Frameworks: Backbone, Ember and Angular JS
JavaScript MVC Frameworks: Backbone, Ember and Angular JS
Harbinger Systems - HRTech Builder of Choice
 

Semelhante a Azure Resource Manager (ARM) Template - A Beginner Guide for Developers (20)

Azure ARM Template
Azure ARM TemplateAzure ARM Template
Azure ARM Template
 
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin TimmermannO365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
O365Con18 - Using ARM Templates to Deploy Solutions on Azure - Kevin Timmermann
 
AWS Summit London 2014 | Deployment Done Right (300)
AWS Summit London 2014 | Deployment Done Right (300)AWS Summit London 2014 | Deployment Done Right (300)
AWS Summit London 2014 | Deployment Done Right (300)
 
Infrastructure as Code on Azure - Show your Bicep! v0.2 - .NetConf 2020 by Do...
Infrastructure as Code on Azure - Show your Bicep! v0.2 - .NetConf 2020 by Do...Infrastructure as Code on Azure - Show your Bicep! v0.2 - .NetConf 2020 by Do...
Infrastructure as Code on Azure - Show your Bicep! v0.2 - .NetConf 2020 by Do...
 
Azure Templates for Consistent Deployment
Azure Templates for Consistent DeploymentAzure Templates for Consistent Deployment
Azure Templates for Consistent Deployment
 
Azure App Service Deep Dive
Azure App Service Deep DiveAzure App Service Deep Dive
Azure App Service Deep Dive
 
JavaScript MVC Frameworks: Backbone, Ember and Angular JS
JavaScript MVC Frameworks: Backbone, Ember and Angular JSJavaScript MVC Frameworks: Backbone, Ember and Angular JS
JavaScript MVC Frameworks: Backbone, Ember and Angular JS
 
Manage Azure Cloud with ARM Templates
Manage Azure Cloud with ARM TemplatesManage Azure Cloud with ARM Templates
Manage Azure Cloud with ARM Templates
 
Sitecore 8.2 Update 1 on Azure Web Apps
Sitecore 8.2 Update 1 on Azure Web AppsSitecore 8.2 Update 1 on Azure Web Apps
Sitecore 8.2 Update 1 on Azure Web Apps
 
Azure arm templates
Azure arm templatesAzure arm templates
Azure arm templates
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
 
Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?
 
Azure Resource Manager (ARM) Templates
Azure Resource Manager (ARM) TemplatesAzure Resource Manager (ARM) Templates
Azure Resource Manager (ARM) Templates
 
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
A Public Cloud Based SOA Workflow for Machine Learning Based Recommendation A...
 
Azure ARM’d and Ready
Azure ARM’d and ReadyAzure ARM’d and Ready
Azure ARM’d and Ready
 
PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...
PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...
PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...
 
Managing Your Cloud Assets
Managing Your Cloud AssetsManaging Your Cloud Assets
Managing Your Cloud Assets
 
Serverless in Azure with Functions
Serverless in Azure with FunctionsServerless in Azure with Functions
Serverless in Azure with Functions
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)
 
Big Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft AzureBig Data Adavnced Analytics on Microsoft Azure
Big Data Adavnced Analytics on Microsoft Azure
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Azure Resource Manager (ARM) Template - A Beginner Guide for Developers

  • 1. Azure Resource Manager (ARM) Template A Beginner Guide for Developers Juv Chan @juvchan juvchan@hotmail.com Senior Azure Developer https://www.linkedin.com/in/juv-chan-6104a540 https://github.com/juvchan http://stackoverflow.com/users/3203213/juvchan
  • 2. Agenda • Personal & Professional Background • ARM Overview • ARM Template Basics • ARM Template Usage - Practical Scenarios Demo • ARM Template Authoring Best Practice • Known Issues / Limitations • ARM Template Troubleshooting Tips
  • 3. • Graduated with a B.ENG. (Computer) Honors degree from the School of Computer Engineering, Nanyang Technological University some years back… • Study & Work in Singapore for 8 year • 2 years of professional hands-on development experience on the Microsoft Azure platform & services. (Azure App Service Web App, Azure Resource Manager Template, Azure PowerShell, Azure SQL Database, Azure Storage Blob, Azure Storage Table, Azure Traffic Manager, Azure HDInsight, Azure Virtual Machine, Azure Active Directory etc. ) • Working closely with the Azure Product Development team based in Redmond, Seattle Background
  • 4. • 3 technical videos on Azure Development & Big Data Analytics featured on Microsoft’s Channel 9 website. • URL: https://channel9.msdn.com/Events/Speakers/juv-chan • Interactive IIS Log Analysis with Azure HDInsight Spark (Linux) • Azure Resource Management (ARM) .NET SDK - A Hands-on Beginner Guide • Azure Web App Management .NET SDK - A Hands-on Guide Technical Videos Featured on CH9
  • 5. Azure Resource Manager (ARM) Overview • Application depend on Infrastructure resources, e.g. Virtual Machine, Web Server, Database, Storage, Virtual Network etc. • Traditionally, these resources are viewed as separate, independent entities E.g. Affinity Group in Azure Service Management (Classic) • Azure Resource Manager (ARM) Key Concepts:  Resource Group  Resource Providers  Template Deployment  Tags  Access Control • Backbone of Azure Infrastructure As A Service (IaaS)
  • 6. Azure Resource Manager (ARM) Overview • Resource Group Container for a set of resources for an application • Resource Provider Service Provider that supplies the resources that can be deployed and managed through ARM E.g. Microsoft.Web, Microsoft.Storage, Microsoft.Compute, Microsoft.Network • Template Deployment ARM Template (JSON format) defines the infrastructure for your app, how to configure the infrastructure, and how to publish your app code to that infrastructure
  • 7. Azure Resource Manager (ARM) Overview • Tags Tagging feature enables you to categorize resources based on requirements • Access Control Using Role-Based Access Control (RBAC) to control access to resources Roles: Owner, Reader, Contributor • REST APIs Relying on REST APIs to perform create, read, update, delete (CRUD) operations on resources
  • 8. ARM Template Basics • Define the resources that are needed for the application and specify deployment parameters to input values for different environments. • Deploys and provisions all of the resources for your application in a single, coordinated operation • JSON format • Infrastructure As Code • Single Template File (xxx.template.json) + Single Template Parameter File (xxx.param.json)
  • 9. ARM Template Basic Format { "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", "contentVersion": "", "parameters": { }, "variables": { }, "resources": [ ], "outputs": { } }
  • 10. ARM Template Parameter Basic Format "parameters": { "<parameterName>" : { "type" : "<type-of-parameter-value>", "defaultValue": "<optional-default-value-of-parameter>", "allowedValues": [ "<optional-array-of-allowed-values>" ], "minValue": <optional-minimum-value-for-int-parameters>, "maxValue": <optional-maximum-value-for-int-parameters>, "minLength": <optional-minimum-length-for-string-secureString-array-parameters>, "maxLength": <optional-maximum-length-for-string-secureString-array-parameters>, "metadata": { "description": "<optional-description-of-the parameter>" } } } These parameter values enable you to customize the deployment by providing values that are tailored for a particular environment (such as dev, test, and production). You do not have to provide parameters in your template, but without parameters your template would always deploy the same resources with the same names, locations, and properties.
  • 11. Plan Your Template Before getting started with the template, you should take some time to figure out what you wish to deploy and how you will use the template. Key points to consider: • Which resources types you need to deploy? • Where those resources will reside? • Which version of the resource provider API you will use? • Whether any of the resources must be deployed after other resources? • Which values you want to pass in during deployment, and which values you want to define directly in the template? • Whether you need to return values from the deployment?
  • 12. Ways to deploy ARM Template • Azure Portal • Azure PowerShell • Azure CLI (Cross-Platform Command Line Interface) • Azure SDK (.NET, Java, Python, Node.js, Ruby)
  • 13. ARM Template Usage - Practical Scenarios Demo
  • 14. ARM Template Authoring Best Practice • Visual Studio 2015 is the best authoring tool for ARM Template! • Define Api Versions for different Resource Providers as variables instead of parameters. Much easier to find and replace. • Use ARM Template expression function such as trim(), toLower() as a data cleaning measure to ensure input consistency • Azure Quick Start Template (GitHub) • Azure Resource Manager Schema (GitHub) to get the latest Api Version for the resource providers you’re going to use
  • 15. Known Issues/Limitations • ARM Template File Size limit = 1 MB • ARM Template Parameter File Size = 64 KB • If parameter name value contains “.” character, the ARM template deployment will fail in Azure portal (bug) • E.g. “My.Database” • Variables does not support ARM template expression function such as “reference()”
  • 16. ARM Template Troubleshooting Tips • Azure Resource Explorer https://resources.azure.com/ • Azure Audit Log • Azure Quick Start Templates (GitHub) • Azure Resource Manager Schema (GitHub) • Stack Overflow / MSDN Forums
  • 17. • Azure Resource Manager Overview https://azure.microsoft.com/en-us/documentation/articles/resource-group-overview/ • Azure Quickstart Templates https://azure.microsoft.com/en-us/documentation/templates/ • Azure Resource Manager providers, regions, API versions and schemas https://azure.microsoft.com/en-us/documentation/articles/resource-manager-supported-services/ • Azure Resource Manager Schema https://github.com/Azure/azure-resource-manager-schemas • Azure Resource Manager REST API Reference https://msdn.microsoft.com/en-us/library/azure/dn790568.aspx • Authoring Azure Resource Manager templates https://azure.microsoft.com/en-us/documentation/articles/resource-group-authoring-templates/ Useful Resources & References