42
Automating Your Microsoft Azure Environment

Automating Your Microsoft Azure Environment (DevLink 2014)

Embed Size (px)

DESCRIPTION

Discussion of various automation options available in the Microsoft Azure platform - Azure Automation, PowerShell, Azure Management Libraries, Azure Resource Manager, and Brewmaster.

Citation preview

Page 1: Automating Your Microsoft Azure Environment (DevLink 2014)

Automating Your Microsoft Azure Environment

Page 2: Automating Your Microsoft Azure Environment (DevLink 2014)

Michael S. CollierPrincipal Cloud Architect

[email protected]@MichaelCollierwww.MichaelSCollier.com

Page 3: Automating Your Microsoft Azure Environment (DevLink 2014)

17

COLUMBUS, OH OCTOBER 17, 2014 CLOUDDEVELOP.ORG

Page 4: Automating Your Microsoft Azure Environment (DevLink 2014)

Today’s Agenda1. Why Automation in Azure2. Azure Management Library3. PowerShell4. Azure Automation5. Brewmaster*

* I am employed by Aditi. Brewmaster is an Aditi service.

Page 5: Automating Your Microsoft Azure Environment (DevLink 2014)

Why Automation?Azure is highly automated• Service healing• Internal resources

Time to provision full environments• Compute, storage, etc.

Deployment to multiple geographies• Change only configuration / parameters

Page 6: Automating Your Microsoft Azure Environment (DevLink 2014)

Why Automation?

#1 Source of Failed Projects (IMO)

Humans Terrible at Repetitive Tasks

Page 7: Automating Your Microsoft Azure Environment (DevLink 2014)

A Few Options

REST API• Service Management

• Resource Manager

Page 8: Automating Your Microsoft Azure Environment (DevLink 2014)

A Few Options

REST API• Service Management

• Resource Manager

Azure Management Library

Page 9: Automating Your Microsoft Azure Environment (DevLink 2014)

A Few Options

REST API• Service

Management• Resource

Manager

Azure Management Library

PowerShell• Invoke REST• Service

Management• Resource

Manager

Page 10: Automating Your Microsoft Azure Environment (DevLink 2014)

A Few Options

REST API• Service

Management• Resource

Manager

Azure Management Library

PowerShell• Invoke REST• Service

Management• Resource

Manager

XPlat CLI• ??

Page 11: Automating Your Microsoft Azure Environment (DevLink 2014)

A Few Options

REST API• Service

Management• Resource

Manager

Azure Management Library

PowerShell• Invoke REST• Service

Management• Resource

Manager

XPlat CLI• ??

Azure Automation

Page 12: Automating Your Microsoft Azure Environment (DevLink 2014)

A Few Options

REST API• Service

Management• Resource

Manager

Azure Management Library

PowerShell• Invoke REST• Service

Management• Resource

Manager

XPlat CLI• ??

Azure Automation

Brewmaster

Page 13: Automating Your Microsoft Azure Environment (DevLink 2014)

Microsoft Azure Management Library

Page 14: Automating Your Microsoft Azure Environment (DevLink 2014)

Microsoft Azure Management LibraryConsistent modern libraries over the Azure REST API

Source: http://www.BradyGaster.com

Page 15: Automating Your Microsoft Azure Environment (DevLink 2014)

Microsoft Azure Management Library

Source: http://www.BradyGaster.com

Page 16: Automating Your Microsoft Azure Environment (DevLink 2014)

Microsoft Azure Management LibraryScenarios• Integration Testing• Custom provisioning of services (SaaS)• Dev/Test• Resource Governance

• Anything you may want to automate

Page 17: Automating Your Microsoft Azure Environment (DevLink 2014)

Microsoft Azure Management LibraryGet all or just the ones you need

Page 18: Automating Your Microsoft Azure Environment (DevLink 2014)

MAML

Create Web SiteCreate Storage AccountCreate and Deploy Web Role

Page 19: Automating Your Microsoft Azure Environment (DevLink 2014)

• Get the MAML Libraries from NuGet• Microsoft.WindowsAzure.Management

• Get Active Directory Authentication Library• Microsoft.IdentityModel.Clients.ActiveDirectory (search “ADAL”)

• Authenticate against AAD or use ClientCredential• Use Microsoft Account or Organization

• Use resource specific client to perform actions• StorageManagementClient, ComputeManagementClient, etc.

Recap

Page 20: Automating Your Microsoft Azure Environment (DevLink 2014)

PowerShell

Page 21: Automating Your Microsoft Azure Environment (DevLink 2014)

PowerShell CmdletsGet the goods

http://azure.microsoft.com/en-us/downloads/

https://github.com/Azure/azure-sdk-tools/releases

Page 22: Automating Your Microsoft Azure Environment (DevLink 2014)

PowerShellUse cmdlets and/or REST APIs

Ability to script complex environments• Template with an XML parameters file• PowerShell learning curve

Consistent Deployments• Build server or developer machine

Page 23: Automating Your Microsoft Azure Environment (DevLink 2014)

Authentication OptionsInteractive• Azure AD

> Add-AzureAccountVERBOSE: Account "[email protected]" has been added.VERBOSE: Subscription "Cloud Practice Sales Demos" is selected as the default subscription.VERBOSE: To view all the subscriptions, please use Get-AzureSubscription.VERBOSE: To switch to a different subscription, please use Select-AzureSubscription.

* Tip – Profile data stored in C:\Users\<user>\AppData\Roaming\Windows Azure Powershell

Page 24: Automating Your Microsoft Azure Environment (DevLink 2014)

Authentication OptionsProgrammatic• Management certificate• New –credentials option

$userName = "<your organizational account user name>"

$securePassword = ConvertTo-SecureString -String "<your organizational account password>" -AsPlainText -Force

$cred = New-Object System.Management.Automation.PSCredential($userName, $securePassword)

Add-AzureAccount -Credential $cred http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/

Page 25: Automating Your Microsoft Azure Environment (DevLink 2014)

PowerShell:Service Management

Create VMs with custom script extensionDeploy a Cloud Service

Page 26: Automating Your Microsoft Azure Environment (DevLink 2014)

Resource ManagerWhat is Azure Resource Manager?

Resource Group

Unit of Management• Lifecycle• Identity• Grouping

One Resource -> One Resource Group

Page 27: Automating Your Microsoft Azure Environment (DevLink 2014)

RepeatabilityProvide• Idempotency• Orchestration• Resource configuration

Ability To• Source control• Parameterized input/output

SQL - A Website VirtualMachines

SQL-AWebsite

[SQL CONFIG] VM (2x)

DEPENDS ON SQLDEPENDS ON SQL

SQLCONFIG

Image source - http://channel9.msdn.com/Events/Build/2014/2-607

Page 28: Automating Your Microsoft Azure Environment (DevLink 2014)

JSON Templates

Page 29: Automating Your Microsoft Azure Environment (DevLink 2014)

What You NeedAzure Resource Manager Tools Preview (VS2013)

Page 30: Automating Your Microsoft Azure Environment (DevLink 2014)

What You NeedPowerShell (v0.8.7.1)

Switch-AzureMode AzureResourceManagerGet-AzureResourceGroupGalleryTemplate –Identity

Microsoft

Page 31: Automating Your Microsoft Azure Environment (DevLink 2014)

PowerShell:Resource Manager

Create new deployment from gallery (WebSite + SQL)

Create customized image(WebSite + SQL + Redis + WebDeploy)

Page 32: Automating Your Microsoft Azure Environment (DevLink 2014)

Azure Automation

Page 33: Automating Your Microsoft Azure Environment (DevLink 2014)

What is Azure Automation?IT process automation solution for Azure• Creation, monitoring, deployment, & maintenance• PowerShell Workflow engine• Runbooks• Leverage existing PowerShell scripts

Page 34: Automating Your Microsoft Azure Environment (DevLink 2014)

Azure Automation

Stop VMs on a Schedule

Page 35: Automating Your Microsoft Azure Environment (DevLink 2014)

Brewmaster

Page 36: Automating Your Microsoft Azure Environment (DevLink 2014)

BrewmasterAutomated provisioning and deployment in Azure1. Choose Template 2. Configure

Parameters3. Deploy

Page 37: Automating Your Microsoft Azure Environment (DevLink 2014)

Brewmaster TemplatesPre-built templates for popular server workloadsSharePoint, AD, SQL Server Always On, ARR, etc.DSC and PowerShell

Template SDKhttps://github.com/AditiTechnologiesJSON-basedC# Fluent Syntax Builder (NuGet)

Page 38: Automating Your Microsoft Azure Environment (DevLink 2014)

Brewmaster

Create SQL Server AlwaysOn deployment

Page 39: Automating Your Microsoft Azure Environment (DevLink 2014)

Choices . . . When to UseMAML

• PCL (WinPhone/WinStore)

• Higher level languages

PowerShell

• DevOps• Templates• Build Servers• Quicker than portal

Azure Automation

• Schedule Tasks• Integrate with Other

Services• System Center scripts

Brewmaster

• Templates for server workloads

• IaaS-only

Azure Resource Manager

• Future for Azure API• New, well-defined

topology• Unable to export from

cloud

Page 40: Automating Your Microsoft Azure Environment (DevLink 2014)

ResourcesMAML• http://www.jeff.wilcox.name/2014/04/wamlmaml/ • http://

www.bradygaster.com/post/announcing-the-general-availability-of-the-microsoft-azure-management-libraries-for-net

PowerShell• ARM - http://channel9.msdn.com/Events/Build/2014/2-607 • http://michaelwasham.com/windows-azure-powershell-reference-guide/

Azure Resource Manager• http://azure.microsoft.com/blog/2014/08/11/azure-resource-manager-tools-preview/• http://

blogs.msdn.com/b/rmattsampson/archive/2014/08/19/azure-resource-manager-tools-for-visual-studio.aspx

Azure Automation• http://azure.microsoft.com/blog/tag/azure-automation/

Brewmaster• http://brewmaster.aditicloud.com

Page 41: Automating Your Microsoft Azure Environment (DevLink 2014)

Questions?

Page 42: Automating Your Microsoft Azure Environment (DevLink 2014)

Thank You!Michael S. CollierPrincipal Cloud Architect

[email protected]@MichaelCollierwww.MichaelSCollier.com