working with azure resource manager templates

28
Abhishek Sur, Microsoft MVP Product Head, Insync Deployment with ARM templates and GIT

Upload: abhishek-sur

Post on 08-Feb-2017

368 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Working with Azure Resource Manager Templates

Abhishek Sur, Microsoft MVPProduct Head, Insync

Deployment with ARM templates and GIT

Page 2: Working with Azure Resource Manager Templates

AgendaScenarioObjectivesTechnology overviewLab environment and exercises

Page 3: Working with Azure Resource Manager Templates

ScenarioThe Service Management API allows Contoso to manage Azure resources, such as storage accounts, virtual machines, and virtual networks as individual entities. The Service Management API model serves Contoso well, but it does not reflect the fact that these entities are often, in fact, related and independent parts of a larger, single entity. In contrast to the Azure Service Management API, the Azure Resource Management API allows organizations such as Contoso to deploy, manage, and monitor Azure resources as a single group. In addition to this benefit, ARM makes it possible to use declarative templates to define and provision resources in a deployment. Furthermore, Contoso could implement Role-based Access Controls (RBAC) to provide greater security. Finally, using ARM, Contoso would be able to apply tags to resources to organize them logically within the same subscription.Because of the benefits that Azure Resource Management can provide to Contoso, you have been asked to explore how ARM can be used to deploy and manage resources. Specifically, you have been asked to learn how templates can be used to define and deploy Azure Resources.

Contoso, Inc. has successfully been using Azure for some time now. However, Contoso's use of Azure has, up until now, been limited to the use of the Azure Service Management API.

Page 4: Working with Azure Resource Manager Templates

You will:Understand Azure Quickstart templatesLearn about GitHub and GIT repositoriesLearn how to configure Visual Studio Code to use GITLearn how to customize a template and its related parameters JSON file using Visual Studio Code to meet your specific and additional requirementsLearn how to stage and commit changes to the local and remote GIT repository

Objectives

Page 5: Working with Azure Resource Manager Templates

Technology overview

Page 6: Working with Azure Resource Manager Templates

RESOURCE PROVIDER CONRACT

ADFSAAD

RESOURCE MANAGER

SERVICE MANAGEMENT API

Consistent management layer

Curated extensions

Tools

Provider  rest points

Visual StudioMicrosoft Azure

Command line

Cloud On-premises

Contoso

Azure Resource Manager (ARM)

DB

Page 7: Working with Azure Resource Manager Templates

ReferenceReferenc

e

ReferenceReference

Storage account

Virtual network

Cloud service

Subnet-1Disk (blob)

Virtual networkStorage account

VM with IP address

Network Security Group ACLS

(deployed to VM, NIC, or Subnet)

Depends on

LB IP address

Load balancedendpoint with IP address

Load Balance

rVNetSubnet

VM IP addressNICVMStorage

accountDisk

(blob)

Resource groupBack-end pool (NICs)

Resource Manager exampleClassic model (v1) Resource Manager

(v2)

Reference

Page 8: Working with Azure Resource Manager Templates

ARM templates can:• Simplify deployment• Simplify roll-back• Provide cross-resource

configuration and update support • Be used as a learning tool to build

to suitAzure templates are: • Source file, checked-in• Specifies resources and

dependencies (VMs, websites, DBs) and connections (configuration, LB sets)

• Configurable parameters for input/output

Azure Resource Manager templates

Repeatable configurationConfiguration Resource Group

DEPENDS ON SQLDepends on SQL

SQL-A website[SQL CONFIG] VM (2x)

ARM template

SQL-A

DB

Website Virtual machines

Depends on SQL

SQL configuration

Page 9: Working with Azure Resource Manager Templates

Enterprises and system integrators• Internal software development teams• Delivering an application

• Corporate IT• Delivering a capability or cloud capacity

Cloud Service Vendors (CSVs)• Support different multi-tenancy approaches• Distinct deployments per customer• Within the CSV’s subscription• “Bring your own subscription” model that uses customer subscriptions

• Scale units within a central multi-tenant system• Support ability to make available via the marketplaceAll deploy known configurations/SKUs/VM sizes

Common use cases for ARM templates

Page 10: Working with Azure Resource Manager Templates

Wide range of Quickstart templates• Indexed on Azure.com• GitHub repo• Community and Microsoft contributedIntegration of IaaS with Azure Services

Getting started with Azure templates

Many examples available @ https://github.com/Azure/azure-quickstart-templates

Page 11: Working with Azure Resource Manager Templates

JSON files—simpler than they lookSchema, content version, parameters, variables, resources, and outputs

Page 12: Working with Azure Resource Manager Templates

Passing state—common parametersName (string values)

Description

Location The location where the resources will be deployed from a constrained list of Azure regions

storageAccountNamePrefix

Unique DNS name for the storage account where the VM’s disks will be placed

virtualNetworkName For deployments that create a new virtual network, the name to use for creating that resource. For deployments that use an existing virtual network, the name of the VNet to deploy into

username User name for the virtual machine(s) and potentially the application(s). More than one user name can be requested from the end user, but at least one must be prompted

password Password for the virtual machine(s) and potentially the application(s). More than one password can be requested from the end user for different VMs or applications, but at least one must be prompted

tshirtSize The named scale unit size to provision from a constrained list of offered t-shirt sizesFor example, “Small”, “Medium”, “Large”

enableJumpbox Parameter that identifies whether to enable a jumpbox for the environmentvalues: “enabled”, “disabled”

Page 13: Working with Azure Resource Manager Templates

Deploying custom JSON files

New-AzureResourceGroupDeployment -DeploymentName "Simple-VM" -ResourceGroupNameRG-AZITCAMP -TemplateFile "C:\GitHub\Templates\101-simple-windows-vm\azuredeploy.json

Page 14: Working with Azure Resource Manager Templates

Tools to help manage templatesGitHubVisual Studio CodeNotePad/NotePad++

Page 15: Working with Azure Resource Manager Templates

GITA widely used version control system for software developmentA distributed revision control system with an emphasis on speed, data integrity, and support for distributed, non-linear workflowsA full-fledged repository with complete history and full version-tracking capabilities, independent of network access or a central server

Page 16: Working with Azure Resource Manager Templates

https://github.com • The largest code host on the planet with

over 27.6 million repositories • Every repository comes with the same

powerful tools• Tools are open to the community for public

projects and secure for private projects• Allows for creation of a GIT Desktop and

cloned repository

GitHub

Page 17: Working with Azure Resource Manager Templates

Visual Studio Code integration with GITOpen your team repository in Visual StudioClone your repositoryCreate a new appConfirm your settings and add the appSnapshot (commit) your codePull changes from your teamPush your local commits to the server

Page 18: Working with Azure Resource Manager Templates

Lab environment and exercises

Page 20: Working with Azure Resource Manager Templates

AZRCamp-Admin.contoso.com(Windows 10; used for Azure Management)

AZRCamp-DC.contoso.com(Windows Server 2012 R2; domain controller, DNS)

AZRCamp-Sync.contoso.com(Used for synchronization in some labs)

AZRCamp-Edge(Stand-alone Windows Server 2012 R2; RRAS)

Azure Boot Camp virtual machines

Page 21: Working with Azure Resource Manager Templates

Prepare the Azure infrastructure• AZCampStart.ps1Understand Azure templates and resource groups• Understand Azure Quickstart templates• Review a template from GitHub

Azure infrastructure

Page 22: Working with Azure Resource Manager Templates

Create GitHub account and public repositoryConfigure GitHub desktop and clone repositoryExamine Visual Studio Code integration with GIT and push commits to remote repository

Configure GIT repositories and Visual Studio Code

Page 23: Working with Azure Resource Manager Templates

↪.\RGCleanup.ps1

• Modify sample template and parameter JSON files

• Deploy custom JSON filesReset the Azure environment• Remove resource groups from

Azure environment

Modify and deploy Azure QuickStart templates

Page 24: Working with Azure Resource Manager Templates

Conclusion

Page 25: Working with Azure Resource Manager Templates

You now:Understand Azure Quickstart templatesLearn about GitHub and GIT repositoriesLearn how to configure Visual Studio Code to use GITLearn how to customize a template and its related parameters JSON file using Visual Studio Code to meet your specific and additional requirementsLearn how to stage and commit changes to the local and remote GIT repository

In review: Session objectives and takeaways

Page 26: Working with Azure Resource Manager Templates

Thank you

Page 27: Working with Azure Resource Manager Templates

ResourcesWatch the Channel 9 Show, “Your Premises or Mine”Get the latest On-Premises and In-Cloud technologies.

aka.ms/YourPremises

Try Azure for free.Sign up for a free one-month trial.

aka.ms/TryAzureForMonth

Register for an IT Innovation Series eventTopics include Cloud Infrastructure, Window Server 2016, Windows 10 and more.

aka.ms/ITInnovation

Page 28: Working with Azure Resource Manager Templates

© 2015 Microsoft Corporation. All rights reserved.