continuous delivery of windows azure cloud services (dev310)

27
Continuous Delivery of Windows Azure Cloud Services (DEV310) Paul Yuknewicz Principal Program Manager Lead, Visual Studio [email protected] Microsoft Corporation DEV310

Upload: nguyenkhuong

Post on 13-Feb-2017

223 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Continuous Delivery of Windows Azure Cloud Services (DEV310)Paul YuknewiczPrincipal Program Manager Lead, Visual [email protected] Corporation

DEV310

Page 2: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Session Goals

Automate complete delivery process of Cloud ServicesIntegrate with overall software app dev lifecycleCustomize for your unique environment

Page 3: Continuous Delivery of Windows Azure Cloud Services (DEV310)

AgendaOverviewConfiguring build serverAutomate package build using MSBuildPush packages to Azure using PowerShell scriptsBuild and deploy packages using TFS Team build (on prem)Build and deploy packages using TFS Build Service (cloud)Customizations and best practices throughout

Page 4: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Application Development Lifecycle Developer Machine

Windows Azure SDK for .NET

Development

TestingF5

Dep

loy

Build Server

Check In

Staging

Automated testing

Warm-bloodeduser testing

TFS Build ServerWeb & Azure

Projects

Web & Azure DLL’s

Build

Run Tests ?

Fix Bugs(repeat as necessary)

NightlyBuild -OR-Continuous Integration

Deploy using PowerShell or WF

Open/Close Bugs

CSPKG

Build targets & scripts

Page 5: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Configuring Build ServerPrinciples

Package build task is fast and disconnectedDeployment pushes handled in separate tasks/activities/scriptsDevelopers own the app source code, not build serverFidelity with manual / VS package buildFast failure with validation and logs

Page 6: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Configuring Build ServerConsiderations

Automation runner (MSBuild, TFS Build, scripts, 3rd party)MSBuild tools and build targets (Web, Azure SDK, etc)Windows Azure SDK (allows partial install w/o VS tools, side by side version)PowerShell scripts and Azure SDK cmdletsProcess identity, access control, and secretsTriggersDrop locationsLog and trace output locations

Page 7: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Configuring Build ServerPre-reqs

.NET Framework 4.0 (includes MSBuild)Required MSBuild targets:

Windows Azure SDK – Windows Azure Authoring Tools (1.6 or 1.7)Windows Azure Tools for Visual Studio (doesn’t require VS)Microsoft.WebApplication.targets (copy from VS2010 or VS2012)

MSBuild install paths:VS 2010: \Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0VS 2012: \Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0

Page 8: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Create a cloud package with MSBuildGetting started

set PATH=%PATH%;"C:\Windows\Microsoft.NET\Framework\4.0“

MSBuild /target:Publish

Notes:• Same output as Visual Studio Package command: CSPKG + CSCFG files• Publishes to <ProjectDir>\bin\<Configuration>\app.publish\ • Ensure this is the appropriate path to MSBuild to match your target .NET

framework version• TFS: set these in the MSBuild Arguments property of the process template / build

definition

Page 9: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Create a cloud package with MSBuildOptional parameters

MSBuild /t:Publish /p:TargetProfile=ServiceConfiguration.Test.cscfg

Override cloud config file to publish:

MSBuild /target:Publish /p:PublishDir=\\myserver\drops\

Override drop location:

Page 10: Continuous Delivery of Windows Azure Cloud Services (DEV310)

demo

Build cloud packages

Continuous integration (CI)

Page 11: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Deploy using PowerShellPre-reqs

Windows Azure PowerShell 0.6.0+ cmdletsPublishSettings file with management certificatePre-built package build outputStorage account createdCloud Service container createdCloud Service certificate created and uploaded (optional: for RDP or SSL)

Tip: publish with Visual Studio cloud tools first, or else you must use portal + PowerShell to provision resources

Page 12: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Provisioning resources in PowerShell

New-AzureService -ServiceName myservicedns -Location ‘West US’ -Label ‘myservicedns’

Create a Cloud Service container example:

New-AzureStorageAccount –StorageAccountName mystoragedns -Location ‘West US’ -Label ‘ mystoragedns’

Create a storage account example:

Get-AzureLocationGet-AzureAffinityGroup

List all locations (data centers) and affinity groups:

Page 13: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Upload RDP certificates in PowerShell

<Certificates> <Certificate

name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="C33B6C432C25581601B84C80F86EC2809DC224E8" thumbprintAlgorithm="sha1" /> </Certificates>

First, locate the cert(s) in the cloud configuration (.cscfg) file for your target environment:

Add-AzureCertificate -serviceName 'myservicedns' -CertToDeploy (get-item cert:\CurrentUser\MY\C33B6C432C25581601B84C80F86EC2809DC224E8

Upload certificate from the user store matching the thumbprint (above):

Page 14: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Execute the PowerShell script to publish

PowerShell c:\scripts\windowsazure\PublishCloudService.ps1 –environment Staging -serviceName myservicedns -storageAccountName mystoragedns -packageLocation c:\drops\app.publish\ContactManager.Azure.cspkg -cloudConfigLocation c:\drops\app.publish\ServiceConfiguration.Cloud.cscfg

Example 1: publish to a staging environment on the same service before performing a VIP swap

PowerShell c:\scripts\windowsazure\PublishCloudService.ps1 –environment Production -serviceName testservicedns -storageAccountName mystoragedns -packageLocation c:\drops\app.publish\ContactManager.Azure.cspkg -cloudConfigLocation c:\drops\app.publish\ServiceConfiguration.Cloud.cscfg

Example 2: publish to a test environment in a separate cloud service

Page 15: Continuous Delivery of Windows Azure Cloud Services (DEV310)

demo Publish using PowerShellContinuous deployment (CD)

Page 16: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Configuring TFS build (on-premise)Create a build definition Leverage existing TFS server and build agentsSet MSBuild ArgumentsWire up PowerShell script in process template workflow (XAML)Set Azure specific process properties (cloud service, storage account, publish settings, locations, etc)

Page 17: Continuous Delivery of Windows Azure Cloud Services (DEV310)

demo Publish using TFS (on prem)Continuous deployment (CD)

Page 18: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Configuring TFS elastic build service (cloud)Set up TFS publishing in Azure portal

Wizard does this for youEnables communication between TFS and Azure using OAuthCreates a build definition with Azure process template & activitiesSets the solution to build if one exists in depotSets Continuous Integration trigger (i.e. build/deploy on check-in)

What you can doCustomize triggerCustomize solution to build and solution configOverride all cloud specific properties

Page 19: Continuous Delivery of Windows Azure Cloud Services (DEV310)

demo Publish using Team Foundation Service (tfspreview.com)Continuous deployment (CD)

Page 20: Continuous Delivery of Windows Azure Cloud Services (DEV310)

SummaryAutomation of complete Cloud Services delivery process Integrates with overall software app dev lifecycleFlexible to your unique environments

Complete guidance & code available:On-premise: https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/#step1 Team Foundation Service: https://www.windowsazure.com/en-us/develop/net/common-tasks/publishing-with-tfs/

Page 21: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Related ContentBreakout Sessions:

DEV362 -- From Development to Production: Optimizing for Continuous Delivery (Tues 1:30pm, Jamie Cool) AZR205 -- App Deployment Options for Windows Azure (Tues 5pm, Vishal Joshi)DEV314 -- Azure Development Using Visual Studio (Thurs 10:15am, Paul Yuknewicz)

Visual Studio

Product Demo Stations

Find Me Later At…

Product Demo Stations (Visual Studio) or email [email protected]

Page 22: Continuous Delivery of Windows Azure Cloud Services (DEV310)

DEV Track ResourcesVisual Studio Home Page :: http://www.microsoft.com/visualstudio/en-us

Jason Zander’s Blog :: http://blogs.msdn.com/b/jasonz/

Facebook :: http://www.facebook.com/visualstudio

Twitter :: http://twitter.com/#!/visualstudio

Somasegar’s Blog :: http://blogs.msdn.com/b/somasegar/

Page 23: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Resources

Connect. Share. Discuss.http://northamerica.msteched.com

Learning

Microsoft Certification & Training Resourceswww.microsoft.com/learning

TechNet

Resources for IT Professionalshttp://microsoft.com/technet

Resources for Developershttp://microsoft.com/msdn

Page 24: Continuous Delivery of Windows Azure Cloud Services (DEV310)

Complete an evaluation on CommNet and enter to win!

Page 25: Continuous Delivery of Windows Azure Cloud Services (DEV310)

MS Tag

Scan the Tagto evaluate thissession now onmyTechEd Mobile

Page 26: Continuous Delivery of Windows Azure Cloud Services (DEV310)

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to

be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS

PRESENTATION.

Page 27: Continuous Delivery of Windows Azure Cloud Services (DEV310)