+ All Categories
Home > Documents > Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource...

Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource...

Date post: 20-May-2020
Category:
Upload: others
View: 19 times
Download: 0 times
Share this document with a friend
29
Online Conference June 17 th and 18 th 2015 EVENTS.COLLAB365.COMMUNITY Become an Azure Demigod with Resource Manager Templates
Transcript
Page 1: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

Online Conference

June 17th and 18th 2015EVENTS.COLLAB365.COMMUNITY

Become an Azure Demigod with Resource Manager Templates

Page 2: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

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:

Page 3: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

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:

Page 4: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

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

Page 5: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant
Page 6: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

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

Page 7: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

EVENTS.COLLAB365.COMMUNITY

template-drivendeclarativeidempotentmulti-servicemulti-regionextensible

Azure Resource Manager is

AZURE RESOURCE MANAGER API

Page 8: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

EVENTS.COLLAB365.COMMUNITY

ASM vs. ARMASM/Classic model (v1) Resource Manager (v2)

Page 9: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant
Page 10: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

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?

Page 11: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

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

Page 12: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant
Page 13: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

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

Page 14: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

EVENTS.COLLAB365.COMMUNITY

Template Decomposition

Page 15: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

EVENTS.COLLAB365.COMMUNITY

{"$schema": """contentVersion": ""," parameters": {},

"variables": {},"resources": []}

Template Format

Page 16: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

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

Page 17: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

EVENTS.COLLAB365.COMMUNITY

Inside a JSON TemplateSchema, content version, parameters, variables, resources, and outputs

Page 18: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant
Page 19: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

EVENTS.COLLAB365.COMMUNITY

{"resources": [{

"condition": true|false,"apiVersion": "<apiVersion>","name": "<nestedDeploymentName>","type":

"<rpNamespace/resourceType>","properties": {…}

} ]}

Conditions

Page 20: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

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

Page 21: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

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

Page 22: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant
Page 23: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant
Page 24: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

EVENTS.COLLAB365.COMMUNITY

Continuous Delivery Pipeline

DEV

TFVC

Page 25: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

EVENTS.COLLAB365.COMMUNITY

• Team Foundation Server• Visual Studio Team Services• Jenkins• Teamcity• Octopus• AppVeyor

CI/CD Options with Azure

Page 26: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

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

Page 27: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

EVENTS.COLLAB365.COMMUNITY

Continuous Delivery with VSTS/TFS

Page 28: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant
Page 29: Become an Azure Demigod with Resource Manager Templates · Become an Azure Demigod with Resource Manager Templates. EVENTS.COLLAB365.COMMUNITY Janaka Rangama Principal Consultant

EVENTS.COLLAB365.COMMUNITY

Stay tuned for more great sessions …


Recommended