Online Conference June 17 th and 18 th 2015 EVENTS.COLLAB365.COMMUNITY Become an Azure Demigod with Resource Manager Templates
Online Conference
June 17th and 18th 2015EVENTS.COLLAB365.COMMUNITY
Become an Azure Demigod with Resource Manager Templates
EVENTS.COLLAB365.COMMUNITY
Janaka RangamaPrincipal Consultant @
Email : [email protected] : @JanakaRangama
• Expat hailing from the “Pearl of the Indian Ocean”
• Microsoft MVP | Cloud and DatacentreManagement
• 5Nine Technical Evangelist | Microsoft Azure Advisor
• Community Lead, Author & Speaker• Visit my blog http://tekronin.net
Contact Details:
EVENTS.COLLAB365.COMMUNITY
Nirmal ThewarathanthriTechnical Architect @
Email : [email protected] : @nirmalmt
• Expat hailing from the “Pearl of the Indian Ocean”
• Microsoft MVP | Cloud and DatacentreManagement
• 5Nine Technical Evangelist | Microsoft Azure Advisor
• Community Lead, Author & Speaker• Visit my blog http://nirmalt.com
Contact Details:
EVENTS.COLLAB365.COMMUNITY
Why Azure Resource Manager Resource Groups in a Nutshell Azure Resource Manager Templates ARM Template Tricks Demo Continuous Delivery with Resource Manager Templates Demo
Agenda
EVENTS.COLLAB365.COMMUNITY
There is no way to specify multi-region or multi-service in a single script.Different scripts were used for targeting various services and the execution was orchestrated by the tool
Used Affinity Groups concept for close proximity hints. No consistency in the APIs exposed by services.
XML, some used JSON
Organizing 1000s of resources across the organization was hard. Limited access control exposed in the model.
Subscription co-administrator for providing user access
Limited auditing available from the portal.The List Subscription Operations operation returns a list of create, update, and delete operations that were performed on a subscription during the specified timeframe.
Pitfalls in Azure Service Management
EVENTS.COLLAB365.COMMUNITY
template-drivendeclarativeidempotentmulti-servicemulti-regionextensible
Azure Resource Manager is
AZURE RESOURCE MANAGER API
EVENTS.COLLAB365.COMMUNITY
ASM vs. ARMASM/Classic model (v1) Resource Manager (v2)
EVENTS.COLLAB365.COMMUNITY
container for multiple resources resources exist in one (and only one)
resource group resource groups can span regions resource groups can span services
Deploying with Resource Groups tracks template execution created within a resource group allows nested deployments
RESOURCE GROUP
What are Resource Groups?
EVENTS.COLLAB365.COMMUNITY
• Name-value pairs assigned to resources or resource groups
• Subscription-wide taxonomy• Each resource can have up to 15 tags
Resource Tags
• Tag by environment, e.g. dev/test/prod• Tag by role, e.g. web/cache/db• Tag by department, e.g. finance/retail/legal• Tag by responsible party, e.g. Bob• Tags show up in billing
EVENTS.COLLAB365.COMMUNITY
Why ARM Templates? Ensure Idempotency Simplify orchestration, deployment and roll-back Provide Cross-Resource Configuration and Update
Support
Azure Resource Manager templates
DEPENDS ON SQLDepends on SQL Depends on SQL
SQL configuration
Source file, checked-in Specifies resources and dependencies
(VMs, websites, DBs) and connections (configuration, LB sets)
Configurable parameters for input/output
EVENTS.COLLAB365.COMMUNITY
Template Decomposition
EVENTS.COLLAB365.COMMUNITY
{"$schema": """contentVersion": ""," parameters": {},
"variables": {},"resources": []}
Template Format
EVENTS.COLLAB365.COMMUNITY
Element name Required Description
$schema Yes Location of the JSON schema file that describes the version for the template language. You should use the URL.
contentVersion Yes Version of the template. (i.e.1.0.0.0). Any value can be provided. When deploying resources using the template, this value ensures that the right template is being used.
parameters No Values that are provided when deployment is executed to customize resource deployment
variables No Values that are used as JSON fragments in the template to simplify template language expressions
resources Yes Resource types that are deployed or updated in a resource group
outputs No Values that are returned after deployment
Template Format
EVENTS.COLLAB365.COMMUNITY
Inside a JSON TemplateSchema, content version, parameters, variables, resources, and outputs
EVENTS.COLLAB365.COMMUNITY
{"resources": [{
"condition": true|false,"apiVersion": "<apiVersion>","name": "<nestedDeploymentName>","type":
"<rpNamespace/resourceType>","properties": {…}
} ]}
Conditions
EVENTS.COLLAB365.COMMUNITY
FunctionsSet Functions:
• contains()• empty()• intersection()• union()• first()• last()• indexOf()• lastIndexOf()• startsWith()• endsWith()• max()• min()• range()
Conversion Functions:• array()• createArray()• bool()• float()
Logical Operators:• less()• lessOrEquals()• greater()• greaterOrEquals()• equals()
Logical Functions:• and• bool• if• not• or
Resource Functions:• listKeys and list{Value}• providers• reference• resourceGroup• resourceId• subscription
EVENTS.COLLAB365.COMMUNITY
"resources": [ {
"apiVersion": "2017-05-10", "name": "linkedTemplate", "type": "Microsoft.Resources/deployments", "properties": {
"mode": "incremental", "templateLink": {
"uri": "https://www.contoso.com/AzureTemplates/newStorageAccount.json","contentVersion": "1.0.0.0"
}, "parameters": {
"StorageAccountName":{"value": "[parameters('StorageAccountName')]"} }
} }
]
Linked Templates
EVENTS.COLLAB365.COMMUNITY
Continuous Delivery Pipeline
DEV
TFVC
EVENTS.COLLAB365.COMMUNITY
• Team Foundation Server• Visual Studio Team Services• Jenkins• Teamcity• Octopus• AppVeyor
CI/CD Options with Azure
EVENTS.COLLAB365.COMMUNITY
Source Control• Git• GitHub • Visual Studio Team Services
Tools • Any Text Editor• Visual Studio• Visual Studio Code• ARM Visualizer• Resource Explorer
Author
Validate
Test
Deploy
Monitor
Manage your ARM templates with
EVENTS.COLLAB365.COMMUNITY
Continuous Delivery with VSTS/TFS
EVENTS.COLLAB365.COMMUNITY
Stay tuned for more great sessions …