Deploying Production Projects to the Cloud with the New Windows Azure Portal
The Windows Azure team sent the following message to all Windows Azure account holders on 10/9/2009:
Windows Azure CTP participant,
You are receiving this mail because you have an application or storage account in Windows Azure in the “USA - Northwest” region. Windows Azure production applications and storage will no longer be supported in the ‘USA-Northwest’ region. We will be deleting all Windows Azure applications and storage accounts in the “USA - Northwest” region on October 31st.
To move your application/storage, first delete the project using the “Delete Service” button. Then recreate it, choosing the “USA - Southwest” region. (It may take a few minutes for your previous application and storage account names to become available again.)
Note that deleting your storage account will destroy all of the data stored in that account. Copy any data you wish to preserve first.
If you would like help migrating your project or have any other concerns, please reply to this mail.
- The Windows Azure Team
I started migrating these sample applications from Cloud Computing with the Windows Azure Platform on 10/26/2009:
- Chapter 4: OakLeaf Systems Azure Table Services Sample Project
- Chapter 4: OakLeaf Systems Azure Blob Services Test Harness
- Chapter 5: OakLeaf Systems Azure Table Test Harness (Secure Sockets Layer, Personally Identifiable Data Encrypted with AES-128)
- Chapter 6: OakLeaf Systems Azure Table Test Harness: HTTPS, Encrypted, with ASP.NET Membership Provider
- Chapter 7: OakLeaf Systems Azure Test Harness with Windows Live ID Authentication
- Chapter 8: OakLeaf Systems: Photo Gallery Azure Queue Test Harness
This tutorial supplements Chapter 2’s “Deploying Applications and Services to the Azure Cloud” section, which starts on page 42, and Chapter 4’s “Creating Storage Accounts” section, which starts on page 64.
Following is the step-by-step process for using the renovated Windows Azure portal to re-create Windows Azure apps in Microsoft’s recently activated South Central US (San Antonio, TX) data center. The process is based on the Azure Table Services Sample Project and the Windows Azure SDK/Tools for Visual Studio July 2009 CTPs.
Delete the Old and Create a New Hosted Service
1. Navigate to the portal’s Provisioning page at https://windows.azure.com/Cloud/Provisioning/Default.aspx and sign in with your Windows Live ID to open the My Projects page:
The SQL Server Data Services (SSDS) team assigned my PDC08 CTP account prior to PDC 2008. Accounts also are known as projects and subscriptions.
2. Click the Project Name item to open the list of Hosted Service and Storage Accounts. You must delete a service in the original data center (North West US, for this example) before you can create a service with the same DNS name in the new data center (South Central US). You must first Suspend and Delete the instance of a Hosted Service by stopping it, if it’s running, and deleting it. Then click the Delete Service button to delete the Hosted or Storage Service:
3. Click the New Service link to open the Project | Create a New Service page:
4. Click the Hosted Services link to open the Create a Service | Service Properties page. Type an arbitrary Service Label and brief Service Description:
5. Click Next to open the Create a Service | Hosted Service page. Type a valid third-level DNS name in the Service Name text box and click Check Availability. When moving a service, the name is the same as that for the original version. (You might need to wait a few minutes for the service deletion to propagate through the data center.)
6. You’ll probably want all (or at least most) of your Hosted Service and Storage Accounts to share the same affinity group, so select the Yes, This Service Is Related to Some of My Other Hosted Service or Storage Accounts option button.
7. If this is the first service or account in the Affinity Group, click the Create a New Affinity Group radio button, type a name for the new Affinity Group in the text box (USA-SouthCentral for this example), and select a data center location in the Region list:
If you’ve already created a new Affinity Group, select the Use Existing Affinity Group radio button and select the new Affinity Group in the list.
8. Click Create to create the new hosted service, oakleaf1host at oakleaf.cloudapp.net for this example:
Delete, Recreate and Test the Storage Account for the Project
9. It’s a good practice to test your project by running it in the Development Fabric with Cloud Storage, so back up the Storage Account’s data and then delete the Account in the original data center. OakLeaf sample applications include code to generate required data.
The following steps create a new Storage Account in the Affinity Group you created in step 7.
10. Create a new storage account by clicking the New Service link to open the Project | Create a New Service page (see step 3’s screen capture) and click Storage Account to open the Create a Service | Service Properties page.
11. Type an arbitrary name, oakleaf1store1 for this example, in the Service Label text box and a brief Service Description:
12. Click next to open the Create a Service | Storage Account page. Type and test the third-level DNS name for the account, which usually (but not necessarily) is the same as that for the service.
13. Select the Yes, the Service Is Related … and Use Existing Affinity Group radio buttons and select the Affinity group you created in step 7:
14. Click Create to create the new storage service:
15. Copy the Primary Access key to the clipboard, open the project’s ServiceConfiguration.cscfg file and replace the previous AccountSharedKey value with the value copied in step 14:
16. Press F5 to run the project in the Development Fabric with Cloud Storage. The oakleaf.cloudapp.net project opens with an empty Customers table, so the Customers DataGrid isn’t visible:
17. Click the Create Customers button to populate and display the paged DataGrid with the first 12 of 91 customer entities in about 1/4 second:
You can learn more about the project by clicking the here link to navigate to the Azure Storage Services Test Harness: Table Services 1 – Introduction and Overview post of 11/18/2008, which includes links to the remaining six parts of the Tables Services Test Harness series:
- Table Services 2 – The Table Services API (11/18/2008)
- Table Services 3 – Starting the Test Harness Project (11/20/2008)
- Table Services 4 – Programming the Table Services API (11/20/2008)
- Table Services 5 – Generating Classes/Collection Initializers with LIMOG v2 (11/21/2008)
- Table Services 6 – Paging LINQ to REST Query Result Sets (11/22/2008)
- Table Services 7 – Testing for Table Existence at App Startup Only (11/22/2008)
Deploy the Hosted Service from the Development Fabric to the Production Fabric
18. Open the project (\WROX\Azure\Chapter04\SampleWebCloudService\SampleWebCloudService.sln for this example) in Visual Studio 2008/2010, right-click the Cloud Service node and choose Publish to generate the ServiceName.cspkg Service Package file in the \ProjectFolder\bin\Debug\Publish folder, which also contains the ServiceConfiguration.csfg file:
19. If the Azure Services portal isn’t open, right-click the Cloud Service node, and choose Browse to Portal to open the My Projects page and click the Project Name to open the services list, and click the link to the hosted service you added (oakleaf1host for this example) to open its Hosted Service Name page:
20. If you want to bypass the Staging Deployment process, click Deploy to open the Service Name | Production Deployment page. Otherwise, click the bar at the right to display the Staging button.
21. Click the Application Package section’s Browse button, navigate to and select the application’s Service Package file and click Open to add the filename to the Select a File text box. Do the same for the ServiceConfiguration.cscfg file, type a name for the deployment, and click Deploy.
22. After a brief interval required to allocate a new virtual machine instance, the WebRole status changes to Initiated and a Run button replaces the Deploy Button.
23. Click the Run button which changes the status to Initializing. After a few minutes to initialize the new instance the WebRole status changes to Started and Upgrade, Suspend, Configure and Delete (disabled) buttons appear:
Use the Deployment ID to identify a project when requesting assistance deploying your project from an Azure Team member in the the Windows Azure forum.
24. Click the Web Site URL link to run the project from the Windows Azure cloud.