Developing Windows 8 Apps for the Windows Store offers an unprecedented opportunity for developers and partners!  As reported earlier this month on Blogging Windows, more than 60 Million Windows 8 licenses have been sold and over 1,700 certified systems are available from our OEM partners for Windows 8 and Windows RT.  All this activity certainly fuels eager demand by consumers and professionals alike for new Windows 8 Apps.

Do you have a great idea for a new Windows 8 App, but don’t yet have hardware for running Windows 8 and the associated development tools?  In this article, I’ll walk you through the process of building your Windows 8 application development lab in the cloud for FREE by leveraging our Windows Azure FREE 90-Day Trial Offer

Note: In this guide, we’ll be building a Windows 8 application development lab environment using Windows Server 2012 because Windows 8 is not currently supported for running as a VM on the Windows Azure cloud platform.  By following the steps in this guide, you’ll be customizing Windows Server 2012 to behave like the Windows 8 client UI so that you can develop and test new Windows 8 Apps.

What does FREE really mean?

Using the process outlined in this article, you’ll be able to build a functional application development lab environment that will be accessible for approximately 375 hours of compute usage each month at no cost to you during the 90-Day Trial Offer period.  You can use this lab environment to develop, test and submit your new Windows 8 Apps to the Windows Store.

After the 90-day trial period has ended, you can choose if you’d like to convert to a paid subscription.  If you choose to convert to a paid subscription, this lab environment will cost approximately $0.16 USD per hour of compute usage ( that’s right – just 16 cents per hour ) plus associated storage and networking costs ( which can typically be less than $5 USD per month for a lab of this nature ). These estimated costs are based on published Pay-As-You-Go pricing for Windows Azure that is current as of this article’s date.

But wait, there’s more! 

  • Generation App - For assistance with designing and developing your new Windows 8 App after you’ve built your lab below, sign up for this FREE program to embark on a 30-day expert-guided application development journey.
     
  • Windows 8 App Design Templates - If you're not a graphics design artist and want to get started on your new Windows 8 App quickly, check out this list of 50 FREE eye-catching Windows 8 App design templates that are "Windows Store-ready"!

Prerequisites

The following is required to complete this step-by-step guide:

  • A Windows Azure subscription with the Virtual Machines Preview enabled.
     
    DO IT: Sign up for a FREE Trial of Windows Azure 
     
    When activating your FREE Trial for Windows Azure, you will be prompted for credit card information.  This information is used only to validate your identity and your credit card will not be charged, unless you explicitly convert your FREE Trial account to a paid subscription at a later point in time. 
     
    NOTE: If you already have a paid subscription or MSDN subscription for Windows Azure, please ensure that you have activated the Windows Azure Virtual Machines and Virtual Networks Preview Feature.  When signing up for a free trial account, this feature will automatically be activated.
     
  • Completion of the Getting Started tasks in the following article:
     
    DO IT: Getting Started with Windows Azure Virtual Machines
     
  • For developers working locally on Mac or Linux PCs, you'll also need the following tools to manage and connect to Windows Azure VMs:
     

Let’s Get Started!

In this step-by-step guide, you will learn how to:

  • Provision Windows Server 2012 in a Windows Azure VM
  • Configure Windows Server 2012 for Windows 8 App Development
  • Install Windows 8 App Development Tools
  • Export / Import Lab Environment On-Demand

Estimated time to complete: 45 minutes

Exercise 1: Provision Windows Server 2012 in a Windows Azure VM

Provision a new Windows Azure VM to run Windows Server 2012 as the basis of your Windows 8 App Development lab environment by performing the following steps:

  1. Sign in at the Windows Azure Management Portal with the logon credentials used when you signed up for your Free 90-Day Windows Azure Trial.
     
  2. Select Virtual Machines located on the side navigation panel on the Windows Azure Management Portal page.
     
    image
    Virtual Machines page in Windows Azure Management Portal
     
  3. Click the +NEW button located on the bottom navigation bar and select Compute | Virtual Machines | From Gallery.
     
    image
    Creating a New Virtual Machine From Gallery
     
  4. In the Virtual Machine Operating System Selection list, select Windows Server 2012, December 2012 and click the Next button.
     
    image
    Virtual Machine Operating System Selection
     
  5. On the Virtual Machine Configuration page, complete the fields as follows:
     
    - Virtual Machine Name: XXXwin8dev01 ( where XXX represents your initials ) 
     
    - New Password and Confirm Password fields: Choose and confirm a new local Administrator password.
     
    - Size: Medium (2 cores, 3.5GB Memory)
     
    image
    Virtual Machine Configuration
     
    Click the Next button to continue.
     
    Note: It is suggested to use secure passwords for Administrator users and service accounts, as Windows Azure virtual machines could be accessible from the Internet knowing just their DNS.  You can also read this document on the Microsoft Security website that will help you select a secure password: http://www.microsoft.com/security/online-privacy/passwords-create.aspx.
     
  6. On the Virtual Machine Mode page, complete the fields as follows:
     
    - Standalone Virtual Machine: Selected
     
    - DNS Name: XXXwin8dev01.cloudapp.net
     
    - Storage Account: Select the Storage Account defined in the Getting Started steps from the Prerequisites section above.
     
    - Region/Affinity Group/Virtual Network: Select the Affinity Group defined in the Getting Started steps from the Prerequisites section above.
     
    image
    Virtual Machine Mode
     
    Click the Next button to continue.
     
  7. On the Virtual Machine Options page, click the Checkmark button to begin provisioning the new virtual machine.
     
    image
    Provisioning a New Virtual Machine
     
    As the new virtual machine is being provisioned, you will see the Status column on the Virtual Machines page of the Windows Azure Management Portal cycle through several values including Stopped, Stopped (Provisioning), and Running (Provisioning)
     
    When provisioning for this new Virtual Machine is completed, the Status column will display a value of Running and you may continue with the next exercise in this guide.

Exercise 2: Configuring Windows Server 2012 for Windows 8 App Development

In this exercise, you will configure Windows Server 2012 running in a Windows Azure Virtual Machine to use Windows 8-style user interface settings so that you can use this environment for developing and testing Windows 8 Apps.

  1. After the new virtual machine has finished provisioning, click on the name ( XXXwin8dev01 ) of the new Virtual Machine displayed on the Virtual Machines page of the Windows Azure Management Portal.  This will display the Virtual Machine Details Page for XXXwin8dev01.
     
    image
    Virtual Machine Details Page
     
  2. On the Virtual Machines Details Page for XXXwin8dev01, click the Connect button located on the bottom navigation toolbar and click the Open button to launch a Remote Desktop Connection to the console of this virtual machine. 
     
    image
    Launching a Remote Desktop Connection
     
  3. If prompted, in the Remote Desktop Connection Security Warning window, check the option for Don’t ask me again for connections to this computer and click the Connect button.
     
    image
    Remote Desktop Connection Security Warning
     
  4. In the Windows Security dialog box, click the option to Use another account and enter the Administrator username and password used when provisioning this VM in Exercise 1 above.
     
    image
    Windows Security Dialog Box
     
    Click the OK button to continue.
     
  5. If prompted, in the Remote Desktop Connection Security Warning window, check the option for Don’t ask me again for connections to this computer and click the Yes button.
     
    image
    Remote Desktop Connection Security Warning
     
    You will be logged on to a Remote Desktop console for the newly provisioned virtual machine.  Wait for the logon process to complete and the Server Manager tool to launch before continuing with the next step.         
      
  6. In the Server Manager window, click on the Tools menu choice from the top navigation bar and select the Computer Management tool from the drop-down menu.
     
    image
    Selecting the Computer Management Tool
     
  7. In the Computer Management window, expand Local Users and Groups in the left navigation pane and right-click on the Users folder located below it.  Select New User… from the pop-up menu. 
     
    image
    Computer Management Window
     
  8. In the New User dialog box, complete the following fields to create a new Developer user account:
     
    - User name: Developer
     
    - Full name: Developer
     
    - Description: Developer user account for Windows 8 Apps
     
    - Password and Confirm Password: Choose and Confirm a new secure password.
     
    - User must change password at next logon: Uncheck
     
    image
    New User Dialog Box
     
    Click the Create button and then the Close button to create a new Developer user account.
     
  9. In the Computer Management tool, select the Groups folder in the left navigation pane.  Right-click on the Administrators group and select Add to Group … from the pop-up menu.
     
    image
    Add to Group …
     
  10. In the Administrators Properties dialog box, click the Add button and add the new Developer user account to this group.
     
    image
    Administrators Properties Dialog Box
     
    Click the OK button to complete adding the new Developer user account to the local Administrators group.
     
    Close the Computer Management tool.
     
  11. In the Server Manager window, click on the Tools menu choice from the top navigation bar and select the Services tool from the drop-down menu.
     
    image
    Selecting the Services Tool
     
  12. In the Services window, scroll down the list of services to Windows Audio
     
    Double-click on the  Windows Audio service and set Startup Type to Automatic.  Click OK to save this change.
     
    Double-click on the Windows Audio Endpoint Builder service and set Startup Type to Automatic. Click OK to save this change.
     
    Right-click on the Windows Audio service and select Start from the pop-up menu.  Confirm that both Windows Audio and Windows Audio Endpoint Builder services start.
     
    image
    Configuring Windows Audio Services
     
  13. In the Server Management tool, click on the Local Server link in the left navigation pane.  
     
    In the Local Server Properties page click the IE Enhanced Security Configuration link located on the right side of the page. 
     
    In the Internet Explorer Enhanced Security Configuration dialog box, set Administrators and Users to Off.
     
    image
    Internet Explorer Enhanced Security Configuration
     
    Click the OK button to save these changes.
     
    Note: Typically in a production server environment, it is recommended to keep IE Enhanced Security Configuration enabled for both Administrators and Users.  However, because this virtual machine will be an application development lab VM, we are disabling this feature to increase the usability of the lab environment.
     
  14. Inside the Remote Desktop session, press the WINDOWS+R key on your keyboard to pop-up the Run dialog box.  In the Open: field, type REGEDIT.EXE and click the OK button to launch the Registry Editor tool.
     
    image
    Run Dialog Box
     
    Note: If the WINDOWS key does not pass through to the Remote Desktop session, check to make sure that your Remote Desktop Connection window is maximized.  Also, check the Local Resources tab in the options of your Remote Desktop Connection client settings to ensure that the Apply Windows key combinations setting is configured for On the remote computer.
     
  15. In the Registry Editor window, expand out the registry key hierarchy in the left navigation panel to navigate to the following registry location:
     
    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main
     
    In this registry location, double-click on the ApplicationTileImmersiveActivation registry value located in the right pane and set the Value data: field to 1.  Click the OK button to save this change in the registry.
     
    image
    Changing A Registry Value
     
  16. In the Server Manager window, click on the Manage menu choice located on the top navigation bar and select Add Roles and Features from the drop-down menu.
     
    image
    Manage menu in Server Manager
     
  17. In the Add Roles and Features Wizard window, click the Next button to accept default values on each page until you reach the Select Features page. 
     
    On the Select Features page, scroll down to User Interfaces and Infrastructure (Installed).  Expand this feature and select the checkbox for the Desktop Experience feature.
     
    When prompted, click the Add Features button and then click the Next button followed by the Install button to install the Windows 8-style Desktop Experience feature.
     
    image
    Installing the Desktop Experience Feature
     
    After the Desktop Experience feature has been completed, you will be prompted to restart your virtual machine.
     
    image
    Restart notification from Add Roles and Features Wizard
     
    At this point, close the Remote Desktop Connection session to the Windows Server 2012 virtual machine.
     
  18. On the Windows Azure Management Portal, navigate back to the Virtual Machine Details page for the XXXwin8dev01 virtual machine.
     
    image
     
    Click on the Restart button located on the bottom toolbar to restart the virtual machine.
     
    After the virtual machine restarts, you may continue with the next exercise in this guide.
     
    Note: This restart may take a few minutes to complete, as the installation of components related to the Desktop Experience feature will be installed and configured during this restart cycle.  You can refresh your browser window to force an immediate update of the status of the virtual machine to be reflected on the Windows Azure Management Portal.

Exercise 3: Install Windows 8 App Development Tools

In this exercise, you will logon to the virtual machine as the Developer user account configured in Exercise 2 and install the necessary Windows 8 App Development Tools for developing, testing and publishing new Windows 8 Apps.

  1. On the Virtual Machines Details Page for XXXwin8dev01, click the Connect button located on the bottom navigation toolbar and click the Open button to launch a Remote Desktop Connection to the console of this virtual machine. 
     
    image
    Launching a Remote Desktop Connection
     
  2. In the Windows Security dialog box, click the option to Use another account and enter the Developer username and password configured in Exercise 2 above.     
     
    image 
    Windows Security Dialog Box
     
    You will be logged on to a Remote Desktop console for the newly provisioned virtual machine.  Wait for the logon process to complete and the Server Manager tool to launch before continuing with the next step.
     
  3. In the Server Manager window, click on the Manage menu choice on the top navigation bar and select Server Manager Properties from the drop-down menu.
     
    image
    Server Manager Properties menu choice
     
  4. In the Server Manager Properties dialog box, check the checkbox option for Do not start Server Manager automatically at logon and click the OK button.
     
    image
    Server Manager Properties
     
    Because this user account will be used for Windows 8 App development, starting Server Manager automatically at each logon will not be necessary.
     
    Close the Server Manager window.
     
  5. From within the Remote Desktop Connection session to the VM, press the WINDOWS key to navigate to the Windows 8-style Start Screen.
     
    image
    Windows 8-style Start Screen
     
  6. On the Windows 8-style Start Screen, click the Internet Explorer tile and navigate to this step-by-step guide by browsing to http://aka.ms/W8CloudLab.
     
    From within the Remote Desktop Connection session, scroll back down to this step and complete the remainder of this exercise from within the virtual machine.
     
  7. Using Internet Explorer on the virtual machine, browse to Install Windows 8 Developer Tools 
     
    image
    Windows Dev Center for Windows Store Apps
     
  8. Under the heading Download the tools and SDK, click on the Download now button. When prompted on whether to Run, Save, or Cancel, click the Run button to launch the installation.
     
    image
    Run the Installation of Developer Tools and SDK
     
  9. In the Visual Studio installation window, review and check the option I agree to the License Terms and conditions.  Click the INSTALL button to proceed.
     
  10. In the User Account Control dialog box, click the Yes button.  The installation will now continue.
     
    image
    Visual Studio Installation in Progress
     
    The installation will take a few minutes to complete.  When completed, click on the LAUNCH button to continue with the next step in this exercise.
     
    image
    Visual Studio Installation Completed
     
  11. In the Visual Studio registration window, click the Register online link.  A registration web page will launch.
     
    image
    Visual Studio Registration Window
     
    Login to the registration web page with your Microsoft account (aka. Windows Live ID) and complete the registration form. 
     
    After submitting your registration form, copy and paste the Product Key on the registration web page into the Product Key field in the Visual Studio registration window.
     
    Click the Next button to continue.  If prompted with a User Account Control security dialog box, click Yes to continue.
     
  12. In the Visual Studio – Product Key Applied window, click the Close button.
     
    image
    Visual Studio Product Key Applied
     
  13. After Visual Studio launches for the first time, a Developer License window will be displayed. 
     
    image
     
    Review and click the I Agree button.  If prompted with a User Account Control security dialog box, click the Yes button to continue.
     
  14. In the Developer License dialog box, login with your Microsoft Account (aka. Windows Live ID) to acquire a Windows 8 App Developer License.
     
    image
    Developer License Dialog Box
     
  15. A new developer license will be provisioned and downloaded to your installed copy of Visual Studio.  Once complete, a confirmation dialog box will be displayed.
     
    image
    Developer License Confirmation Dialog Box
     
    Click the Close button to continue.

Your virtual machine environment is now prepared for developing, testing and submitting new Windows 8 Apps!

Exercise 4: Export / Import Lab Environment On-Demand

Our functional Windows 8 App Dev lab environment is now complete, but if you’re like me, you won’t be using this lab environment 24x7 around-the-clock.  As long as the virtual machine is provisioned, it will continue to accumulate compute hours against your Free 90-Day Windows Azure Trial account regardless of virtual machine state – even in a shutdown state!

To preserve as many of your free compute hours as possible for productive lab work, we can leverage the Windows Azure PowerShell module to de-provision the lab virtual machine when not in use and re-provision the lab virtual machine when it is needed again.   In this exercise, I'll walk through the steps to spin our lab environment up and down on-demand using Windows PowerShell, but if you're using a non-Windows platform locally, you can also perform these same steps with our Windows Azure command-line tools.

Once you’ve configured the code snippets, you’ll be able to spin up your Windows 8 App Dev lab environment when needed in as little as 5-10 minutes!

Note: Prior to beginning this exercise, please ensure that you’ve downloaded, installed and configured the Windows Azure PowerShell module as outlined in the Getting Started article listed in the Prerequisite section of this step-by-step guide.  For a step-by-step walkthrough of configuring PowerShell support for Azure, see Setting Up Management by Brian Lewis, one of my peer IT Pro Technical Evangelists.

  1. De-provisioning your lab. Use the PowerShell snippet below to shutdown and export your lab environment when you’re not using it. 

    NOTE: Prior to running this script, be sure to edit the first line to reflect the name of your VM and confirm that the $ExportPath folder location exists.
     
    $myVM = "XXXwin8dev01" 
    Stop-AzureVM -ServiceName $myVM -Name $myVM 
    $ExportPath = "C:\ExportVMs\ExportAzureVM-$myVM.xml" 
    Export-AzureVM -ServiceName $myVM -name $myVM -Path $ExportPath  

     
    After you've confirmed that the Export file exists, you can continue to de-provision your lab environment with the following PowerShell snippet:
     
    Remove-AzureVM -ServiceName $myVM -name $myVM
     
  2. Re-provisioning your lab. Use the PowerShell snippet below to import and re-provision your SharePoint lab environment when you’re ready to use it again.  Prior to running this script, be sure to edit the first two lines to reflect the names of your Virtual Network and VMs. 
     
    $myVM = “XXXwin8dev01" 
    $ExportPath = "C:\ExportVMs\ExportAzureVM-$myVM.xml"    
    Import-AzureVM -Path $ExportPath | New-AzureVM -ServiceName $myVM 
    Start-AzureVM -ServiceName $myVM -name $myVM

Note:  You can also manually de-provision existing virtual machines from the Windows Azure Management Portal web page by deleting a virtual machine.  To manually re-provision a virtual machine, create a new virtual machine from the Windows Azure Management Portal web page by selecting the virtual hard disk in the gallery that was previously used by the virtual machine, rather than selecting an operating system image.

What’s Next? Start Building!

Your Windows 8 App Dev lab environment is complete! Starting building your new Windows 8 App by leveraging these FREE programs and resources as your next step!

Kudos to my friend and colleague, Adam Grocholski, for collaborating with me on the development of this Step-by-Step guide.