Automating Your 
Microsoft Azure Environment
17 
COLUMBUS, OH OCTOBER 17, 2014 CLOUDDEVELOP.ORG
1. Why Automation in Azure 
2. Azure Management Library 
3. PowerShell 
4. Azure Automation 
5. Brewmaster* 
* I am employed by Aditi. Brewmaster is an Aditi service.
Azure is highly automated 
• Service healing 
• Internal resources 
Time to provision full environments 
• Compute, storage, etc. 
Deployment to multiple geographies 
• Change only configuration / parameters
#1 Source of Failed 
Projects (IMO) 
Humans Terrible at 
Repetitive Tasks
REST API 
• Service 
Management 
•Resource 
Manager
REST API 
• Service 
Management 
•Resource 
Manager 
Azure 
Management 
Library
REST API 
• Service 
Management 
• Resource Manager 
Azure 
Management 
Library 
PowerShell 
• Invoke REST 
• Service 
Management 
• Resource Manager
REST API 
• Service 
Management 
• Resource Manager 
Azure 
Management 
Library 
PowerShell 
• Invoke REST 
• Service 
Management 
• Resource Manager 
XPlat CLI 
• ??
REST API 
• Service 
Management 
• Resource Manager 
Azure 
Management 
Library 
PowerShell 
• Invoke REST 
• Service 
Management 
• Resource Manager 
XPlat CLI 
• ?? 
Azure 
Automation
REST API 
• Service 
Management 
• Resource Manager 
Azure 
Management 
Library 
PowerShell 
• Invoke REST 
• Service 
Management 
• Resource Manager 
XPlat CLI 
• ?? 
Azure 
Automation 
Brewmaster
Microsoft Azure 
Management Library
Consistent modern libraries over the Azure REST API
Scenarios 
• Integration Testing 
• Custom provisioning of services (SaaS) 
• Dev/Test 
• Resource Governance 
• Anything you may want to automate
Get all or just the ones you need
PowerShell
Get the goods 
 
http://azure.microsoft.com/en-us/downloads/ https://github.com/Azure/azure-sdk-tools/releases
Use 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
Interactive 
• Azure AD 
> Add-AzureAccount 
VERBOSE: Account "michael.collier@live.com" 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. 
C:Users<user>AppDataRoamingWindows Azure Powershell
Programmatic 
• 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
What is Azure Resource Manager? 
Unit of Management
Provide 
• Idempotency 
• Orchestration 
• Resource configuration 
Ability To 
• Source control 
• Parameterized input/output 
SQL - A Website Virtual 
Machines 
SQL-A 
Website 
[SQL CONFIG] VM (2x) 
DEPENDS ON SQL DEPENDS ON SQL 
SQLCONFIG 
Image source - http://channel9.msdn.com/Events/Build/2014/2-607
Azure Resource Manager Tools Preview (VS2013)
PowerShell (v0.8.7.1) 
Switch-AzureMode AzureResourceManager 
Get-AzureResourceGroupGalleryTemplate –Identity Microsoft
Azure Automation
IT process automation solution for Azure 
• Creation, monitoring, deployment, & maintenance 
• PowerShell Workflow engine 
• Runbooks 
• Leverage existing PowerShell scripts
Brewmaster
Automated provisioning and deployment in Azure
Pre-built templates for popular server workloads 
SharePoint, AD, SQL Server Always On, ARR, etc. 
DSC and PowerShell 
Template SDK 
https://github.com/AditiTechnologies 
JSON-based 
C# Fluent Syntax Builder (NuGet)
MAML 
• 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
Questions?
Automating Your Microsoft Azure Environment (DevLink 2014)

Automating Your Microsoft Azure Environment (DevLink 2014)

  • 1.
    Automating Your MicrosoftAzure Environment
  • 3.
    17 COLUMBUS, OHOCTOBER 17, 2014 CLOUDDEVELOP.ORG
  • 4.
    1. Why Automationin Azure 2. Azure Management Library 3. PowerShell 4. Azure Automation 5. Brewmaster* * I am employed by Aditi. Brewmaster is an Aditi service.
  • 5.
    Azure is highlyautomated • Service healing • Internal resources Time to provision full environments • Compute, storage, etc. Deployment to multiple geographies • Change only configuration / parameters
  • 6.
    #1 Source ofFailed Projects (IMO) Humans Terrible at Repetitive Tasks
  • 7.
    REST API •Service Management •Resource Manager
  • 8.
    REST API •Service Management •Resource Manager Azure Management Library
  • 9.
    REST API •Service Management • Resource Manager Azure Management Library PowerShell • Invoke REST • Service Management • Resource Manager
  • 10.
    REST API •Service Management • Resource Manager Azure Management Library PowerShell • Invoke REST • Service Management • Resource Manager XPlat CLI • ??
  • 11.
    REST API •Service Management • Resource Manager Azure Management Library PowerShell • Invoke REST • Service Management • Resource Manager XPlat CLI • ?? Azure Automation
  • 12.
    REST API •Service Management • Resource Manager Azure Management Library PowerShell • Invoke REST • Service Management • Resource Manager XPlat CLI • ?? Azure Automation Brewmaster
  • 13.
  • 14.
    Consistent modern librariesover the Azure REST API
  • 16.
    Scenarios • IntegrationTesting • Custom provisioning of services (SaaS) • Dev/Test • Resource Governance • Anything you may want to automate
  • 17.
    Get all orjust the ones you need
  • 20.
  • 21.
    Get the goods  http://azure.microsoft.com/en-us/downloads/ https://github.com/Azure/azure-sdk-tools/releases
  • 22.
    Use cmdlets and/orREST APIs Ability to script complex environments • Template with an XML parameters file • PowerShell learning curve Consistent Deployments • Build server or developer machine
  • 23.
    Interactive • AzureAD > Add-AzureAccount VERBOSE: Account "michael.collier@live.com" 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. C:Users<user>AppDataRoamingWindows Azure Powershell
  • 24.
    Programmatic • Managementcertificate • 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
  • 26.
    What is AzureResource Manager? Unit of Management
  • 27.
    Provide • Idempotency • Orchestration • Resource configuration Ability To • Source control • Parameterized input/output SQL - A Website Virtual Machines SQL-A Website [SQL CONFIG] VM (2x) DEPENDS ON SQL DEPENDS ON SQL SQLCONFIG Image source - http://channel9.msdn.com/Events/Build/2014/2-607
  • 29.
    Azure Resource ManagerTools Preview (VS2013)
  • 30.
    PowerShell (v0.8.7.1) Switch-AzureModeAzureResourceManager Get-AzureResourceGroupGalleryTemplate –Identity Microsoft
  • 32.
  • 33.
    IT process automationsolution for Azure • Creation, monitoring, deployment, & maintenance • PowerShell Workflow engine • Runbooks • Leverage existing PowerShell scripts
  • 35.
  • 36.
    Automated provisioning anddeployment in Azure
  • 37.
    Pre-built templates forpopular server workloads SharePoint, AD, SQL Server Always On, ARR, etc. DSC and PowerShell Template SDK https://github.com/AditiTechnologies JSON-based C# Fluent Syntax Builder (NuGet)
  • 40.
    MAML • 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
  • 41.

Editor's Notes

  • #17 Consistent modern libraries over Azure REST API Largely auto-generated .NET Node.js Java
  • #18 MAML provides the basis for the PowerShell cmdlets (old code slowly being replaced)
  • #24 http://azure.microsoft.com/en-us/downloads/ https://github.com/Azure/azure-sdk-tools/releases
  • #25 When working with the management APIs, PowerShell can be valueable
  • #26 C:UsersMichaelAppDataRoamingWindows Azure Powershell
  • #27 http://michaelcollier.wordpress.com/2013/02/28/configuring-connectivity-with-windows-azure-powershell-cmdlets/
  • #30 Resource - an Azure entity such as a VM, WebSite, Storage Account, SQL Database Resource Group Collection of Azure resources Every Resource must exist in one, and only one, Resource Group Unit of Management Lifecyle - deployment, update, delete, obtain status Grouping - Billing
  • #38 Aditi subscription CrazyNinja Show assets – connection and certificate Show Connect-Azure Show Stop-DevelopmentMachines
  • #47 Use PowerShell to script the process Create all the resources – storage accounts, Cloud Service, VMs, Web Site, SQL Database, etc. Deploy the package Perform the VIP Swap Invoke the script from build process