Download presentation
Presentation is loading. Please wait.
1
持續的產出Windows Azure 雲端服務
AZR306 持續的產出Windows Azure 雲端服務 邱英瑞 (Jacky Chiou) 技術支援經理(PREMIER FIELD ENGINEER) Microsoft Corporation
2
課程目標 自動化完成雲端服務的產出流程 結合整體軟體應用程式開發生命週期 為自己的獨特環境做客製 TechEd 2012
11/20/ :29 AM 課程目標 自動化完成雲端服務的產出流程 結合整體軟體應用程式開發生命週期 為自己的獨特環境做客製 © 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.
3
課程大綱 概觀 設定建置伺服器 使用 MSBuild 自動化建置 使用 PowerShell 腳本將打包好的軟體推送到 Azure
使用企業內部的 TFS Team Build 建置及部署打包好的軟體到 Azure 使用雲端版的 TFS Build Service 建置及部署打包好的軟體到 Azure 客製化及最佳化實務做法
4
應用程式開發生命週期 Build targets & scripts Developer Machine Build Server
Fix Bugs (repeat as necessary) Check In Open/Close Bugs Build targets & scripts Development F5 Deploy Nightly Build -OR- Continuous Integration Windows Azure SDK for .NET Testing Staging TFS Build Server Warm-blooded user testing Web & Azure Projects Build Web & Azure DLL’s CSPKG Automated testing Deploy using PowerShell or WF Run Tests ?
5
設定建置伺服器 注意事項 MSBuild 工具及 build targets (Web, Azure SDK, etc)
TechEd 2012 11/20/ :29 AM 設定建置伺服器 注意事項 MSBuild 工具及 build targets (Web, Azure SDK, etc) Windows Azure SDK (可不需要 VS, 可同時安裝多版本並存) PowerShell scripts 及 Azure SDK cmdlets Automation runner (MSBuild, TFS Build, scripts, 3rd party) MSBuild 工具及 build targets (Web, Azure SDK, etc) Windows Azure SDK (可不需要 VS, 可同時安裝多版本並存) PowerShell scripts 及 Azure SDK cmdlets Process identity, access control, and secrets Triggers Drop locations Log and trace output locations © 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.
6
設定建置伺服器 必要條件 .NET Framework 4.0 (包含 MSBuild) 必要的 MSBuild targets:
TechEd 2012 11/20/ :29 AM 設定建置伺服器 必要條件 .NET Framework 4.0 (包含 MSBuild) 必要的 MSBuild targets: Windows Azure SDK – Windows Azure Authoring Tools (1.6 or 1.7) Windows Azure Tools for Visual Studio (可以不用安裝 VS) Microsoft.WebApplication.targets (從 VS2010 或 VS2012 複製) MSBuild 的安裝路徑: VS 2010: \Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0 VS 2012: \Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0 © 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.
7
使用 MSBuild 建立一個 cloud package 開始
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
8
使用 MSBuild 建立一個 cloud package 選擇性參數
發行時, 覆寫 cloud config 檔案: MSBuild /t:Publish /p:TargetProfile=ServiceConfiguration.Test.cscfg 覆寫輸出的位置: MSBuild /target:Publish /p:PublishDir=\\myserver\drops\
9
Continuous integration (CI)
11/20/ :29 AM demo Build cloud packages Continuous integration (CI) © 2007 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.
10
TechEd 2012 11/20/ :29 AM 使用 PowerShell 來部署 必要條件 Windows Azure PowerShell Cmdlets (0.6.1 or higher) PublishSettings 檔案及管理憑證 預先建置 package 建置出產位置 建立儲存體帳號 建立 Cloud Service 容器 Cloud Service 建立及上傳 (選擇性: 使用 RDP 或 SSL) Tip: publish with Visual Studio cloud tools first, or else you must use portal + PowerShell to provision resources © 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.
11
使用 PowerShell 準備資源 建立一個 Cloud Service 容器. 範例: New-AzureService -ServiceName myservicedns -Location ‘West US’ -Label ‘myservicedns’ 建立一個 儲存體 (storage) 帳號. 範例: New-AzureStorageAccount –StorageAccountName mystoragedns -Location ‘West US’ -Label ‘ mystoragedns’ 列出所有的位置 (data centers) 及 affinity groups: Get-AzureLocation Get-AzureAffinityGroup
12
使用 PowerShell上傳 RDP 憑證 <Certificates>
首先, 在您的目標環境的cloud 設定檔(.cscfg)中查找憑證 <Certificates> <Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="C33B6C432C B84C80F86EC2809DC224E8" thumbprintAlgorithm="sha1" /> </Certificates> 從使用者存儲區找到匹配 thumbprint 的憑證上傳 Add-AzureCertificate -serviceName 'myservicedns' -CertToDeploy (get-item cert:\CurrentUser\MY\C33B6C432C B84C80F86EC2809DC224E8
13
執行 PowerShell 腳本來發行 範例 1: 執行 VIP 交換前, 將同一個服務發行到一個 staging 環境 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 範例 2: 將 cloud service 發行到一個正式環境 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
14
Continuous deployment (CD)
11/20/ :29 AM demo 使用 PowerShell 做部署 Continuous deployment (CD) © 2007 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.
15
設定企業內部的 TFS build 建立組建定義 (build definition)
TechEd 2012 11/20/ :29 AM 設定企業內部的 TFS build 建立組建定義 (build definition) 使用即有的 TFS 伺服器及組建代理程式 (build agents) 設定 MSBuild 引數(Arguments) 在流程範本的工作程流(XAML)加上 PowerShell 腳本 設定 Azure 特定流程屬性 (cloud service, storage account, publish settings, locations, 等等) © 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.
16
Continuous deployment (CD)
11/20/ :29 AM demo 使用企業內部的 TFS 做發佈 Continuous deployment (CD) © 2007 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.
17
設定 雲端版的 TFS Build Service
TechEd 2012 11/20/ :29 AM 設定 雲端版的 TFS Build Service 在 Azure 的入口網站設定與 TFS 發行整合 精靈會引導我們完成設定 啟用 TFS 及 Azure 間的驗證 (OAuth) 新增一個組建定義 (build definition) 觸發程序設定為 連續整合 (Continuous Integration) What you can do Customize trigger Customize solution to build and solution config Override all cloud specific properties © 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.
18
使用 Team Foundation Service (tfspreview.com) 做發佈
demo 使用 Team Foundation Service (tfspreview.com) 做發佈 Continuous deployment (CD) © 2007 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.
19
課程總結 完整的自動化雲服務交付流程 結合整體軟體應用程式開發生命週期 靈活地適應您獨特的環境 TechEd 2012
11/20/ :29 AM 課程總結 完整的自動化雲服務交付流程 結合整體軟體應用程式開發生命週期 靈活地適應您獨特的環境 © 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.
20
Resources Continuous Delivery for Cloud Applications in Windows Azure
Continuous Delivery to Windows Azure by Using Team Foundation Service Preview
22
立即啟動!免費開發人員帳戶!! Windows Store / Windows Azure / Windows Phone
擁有 MSDN 訂閱 「取得代碼」後進行註冊 優惠內容: Windows Store / Windows Phone – 啟用後12個月, 完全免費! Windows Azure – 訂閱期間, 每月固定的免費使用量!
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.