Archive for the ‘Windows Azure Platform’ Category.

Come Join My Team!

Developer and Platform EvangelismOne of the best career decisions I’ve made was to join the Windows Azure Platform Evangelism team last July.  Yes, it was a lot of work to uproot the family and move to Seattle, but it was absolutely worth it.  I pinch myself nearly everyday to make sure that it’s not just a dream – the opportunities here are tremendous:

  • Work with an incredible group of smart, driven, technical leaders
  • Interact with product teams, help to shape the direction of product innovation, and work with customers on building awesome applications
  • Build great sample applications, demos, HOLs, and training kits
  • Present at marquee conferences, such as PDC, TechEd, and MIX – many of these around the world
  • Create keynote demos that get highlighted in major conferences
  • Stay on the bleeding edge of technology, reading through specs and working with bits months ahead of their release

My teammate, Vittorio Bertocci, has also blogged about this – definitely read his post, as he’s been a Technical Evangelist much longer than I have, and he still is excited to get out of bed in the morning!

If you want to be a part of a great team and live under an “azure” sky, take a look at this job description and apply today!  Hope to see you soon!

Apply today to join my team!

Using Web Deploy with Windows Azure for Rapid Development

Update: Ryan Dunn has just posted Using Web Deploy with Windows Azure that shows a way to use plugins to simplify the process of using Web Deploy with Windows Azure. He also provides a lot of nice commentary and context around the solution.  Definitely worth reading.

While building your web application, have you ever deployed to Windows Azure and then realized you forgot to make a change?  Or forgot to include an update?  Or maybe you deployed and realized you made a simple mistake, and you want to quickly update it?  We all have.  You’ll then find yourself making the change, creating a new package, and uploading/deploying it.  Then you wait.

Now, in the grand scheme of things, waiting 10 minutes is not a big deal – think about everything you’re getting that you don’t already have at your disposal.  That said, during development and QA, it can be frustrating to have to wait while your role instance upgrades or restarts.

Fortunately, with the updates provided in the Windows Azure SDK 1.3, we can benefit from an existing technology called Web Deploy to make our lives much easier.

A few caveats first:

  1. This technique should only be used for development purposes.
  2. You can only update a single role instance with this technique.
  3. Since you are not updating the Windows Azure package you may lose your changes at anytime.

Be sure and understand the above caveats.  This is only for development purposes.

Okay, ready to get started?  Here are the steps to follow.

  1. Create a new Windows Azure Project called WindowsAzureWebDeploy.  Add an ASP.NET MVC 2 Web Role called MvcWebRole to the solution.  It’s up to you if you want a unit test project.
  2. Created a folder called Startup in your MvcWebRole project.
  3. Create three files in this folder: CreateUser.cmd, EnableWebAdmin.cmd, and InstallWebDeploy.cmd.  For each of these files, change the Copy to Output Directory value to Copy always and the Build Action value to Content.
  4. Within the Startup folder, create a folder called webpicmd.
  5. Download WebPICmdLine here.  For more information, see the MSDN article Using the WebPICmd Command-Line Tool.
  6. Unzip the file webpicmdline_ctp.zip into the webpicmd folder.
  7. In Visual Studio, add the following four files into the solution.  For each of these files, change the Copy to Output Directory value to Copy always.
    • Microsoft.Web.Deployment.dll
    • Microsoft.Web.PlatformInstaller.dll
    • Microsoft.Web.PlatformInstaller.UI.dll
    • WebPICmdLine.exe
  8. Update CreateUser.cmd to include the following code. Be sure to change “webdeployuser” and “password” to different values:
    Code: CreateUser.cmd
    1. net user webdeployuser password /add
    2. net localgroup administrators webdeployuser /add
    3. exit /b 0

  9. Update InstallWebDeploy.cmd to include the following code:
    Code: InstallWebDeploy.cmd
    1. "%~dp0\webpicmd\WebPICmdLine.exe" /Products: WDeploy /xml:https://www.microsoft.com/web/webpi/2.0/RTM/WebProductList.xml /log:webdeploy.txt
    2. net stop wmsvc
    3. net start wmsvc

  10. Update EnableWebAdmin.cmd to include the following code:
    Code: EnableWebAdmin.cmd
    1. start /w ocsetup IIS-ManagementService
    2. reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WebManagement\Server /v EnableRemoteManagement /t REG_DWORD /d 1 /f
    3. net start wmsvc
    4. sc config WMSVC start= auto
    5. exit /b 0

  11. Open the ServiceDefinition.csdef file in the WindowsAzureWebDeploy project.
  12. Add a new InputEndpoint named mgmtsvc with the following values:
    Code: InputEndpoint
    1. <Endpoints>
    2.   <InputEndpoint name="Endpoint1" protocol="http" port="80" />
    3.   <InputEndpoint name="mgmtsvc" protocol="tcp" port="8172" localPort="8172" />
    4. </Endpoints>

  13. Create three Startup Tasks to call the command files in the MvcWebRole.
    Code: Startup Tasks
    1. <Startup>
    2.   <Task commandLine="Startup\EnableWebAdmin.cmd" executionContext="elevated" taskType="simple" />
    3.   <Task commandLine="Startup\InstallWebDeploy.cmd" executionContext="elevated" taskType="simple" />
    4.   <Task commandLine="Startup\CreateUser.cmd" executionContext="elevated" taskType="simple" />
    5. </Startup>

  14. That’s it!

Update (12/21/2010): I have made a few updates above to the scripts based on feedback and testing.

At this point, you are ready to deploy your application.  When the role instance starts-up, the three start-up tasks will run and 1) create an user, 2) install web deploy through the Web Platform installer, and 3) enable web administration.  This process can take several minutes to complete.

Once deployed, your application should look like this:

Pre-Web Deploy

Now it’s time to setup your MvcWebRole project to publish directly to your role instance through web deploy.  First, though, make a quick change to your application so that, after you deploy, you can verify that the new bits are deployed.

Update Views –> Home –> Index.aspx and replace the existing header with:

Code: Updated Index.aspx
  1. <h2>Deployed with Web Deploy</h2>

Now, let’s publish the update.

  1. Right-click MvcWebRole and click Publish….
  2. Create a profile name (e.g. MvcWebRole).
  3. Add your full DNS name as the Service URL (e.g. mywebdeploy.cloudapp.net).
  4. Add the Site/application value.  This is essentially yourrolename_IN_0_Web (e.g. MvcWebRole_IN_0_Web).  Don’t forget the “_Web” at the end.
  5. Check the Mark the IIS application on destination checkbox.
  6. Remove the check from the Leave extra files on the destination (do not delete) checkbox.
  7. Check the Allow untrusted certificate checkbox.
  8. Add your User name (e.g. “webdeployuser”).
  9. Add your Password.
  10. Check the Save password checkbox.
  11. Click Publish.

Once complete, your Publish Web window should look something like this:

image

After you get the message Publish succeeded, refresh your page.  It should now look like this:

DeployedWithWebDeploy

And there you have it!  Within seconds you’ve deployed updates to your application running in Windows Azure.

Now, do you remember the caveats above?  If nothing else, remember that this is only for development purposes.  I don’t want to hear that you used this in production then lost all your changes when a role instance was restarted.

I hope this helps!

Use the WAPTK to help setup your Windows Azure development environment

As awesome as it is to have a lot of great local development tools, it’s also be difficult to setup new development environments.  Downloading and installing the Windows Azure SDK is really only one step – you also have to ensure that local services are configured correctly (e.g. IIS), you may need additional SDKs (e.g. Windows Identity Foundation SDK), setup additional tools (e.g. SSMS), and so on.  Not only does this take time but also organizational skills.

So, is there anything that can help manage this process?

Yes.  As part of the Windows Azure Platform Training Kit (WAPTK), we ship a Dependency Checker tool along with scripts that check your system for all the required software to complete the hands-on labs in the kit.  I routinely use this tool to ensure that I have all the software required in order to build great applications for Windows Azure.

Try it out.  First, grab latest version of the WAPTK here.  Then follow these steps.

  1. Click the Prerequisites tab.
  2. Click the Check dependencies link.
    image
  3. If you are prompted to install the Dependency Checker tool, click OK to start the installation.
    image
  4. Once the Dependency Checker tool is install, hit F5 to refresh the page (this will allow the script to call to launch the Dependency Checker tool).
  5. When prompted to allow the ConfigurationWizard to run, click the Allow button.
    image
  6. Now that the Configuration Wizard has launched, click Next to begin.
    image
  7. The first (and only) step is to check prerequisites for the Training Kit.  Click Next to continue.
    image
  8. The tool will scan your system and look for required software.  When it finds that your system is missing required software, you are both notified and provided with a link to Install the software.
    Install
  9. Clicking the Install link will generally launch a process to install the feature.
    image
  10. In some cases you will have the option to download the missing feature or software.  Click the Download links to launch a download.  You will then have to walk through the installation process for that feature.
    Download
  11. At any point you can click the Rescan button to scan your system again.  Any updates you’ve made will be reflected on the scan.
    image
  12. Once you have all of the required software, you’ll be able to complete the tool.  However, if there is software you do not need or want to install, you can cancel at any time to finish.

I hope you find this useful!  Please let me know if you have any feedback.

Windows Azure Platform Training Kit, December 2010 Update

I am happy to announce that we have released the December 2010 update to the Windows Azure Platform Training Kit.

The Windows Azure Platform Training Kit includes a comprehensive set of technical content including hands-on labs, presentations, and demos that are designed to help you learn how to use the Windows Azure platform including: Windows Azure, SQL Azure and the Windows Azure AppFabric.

The December update provides new and updated hands-on labs, demo scripts, and presentations for the Windows Azure November 2010 enhancements and the Windows Azure Tools for Microsoft Visual Studio 1.3. These new hands-on labs demonstrate how to use new Windows Azure features such as Virtual Machine Role, Elevated Privileges, Full IIS, and more. This release also includes hands-on labs that were updated in late October and November 2010 to demonstrate some of the new Windows Azure AppFabric services that were announced at the Professional Developers Conference (http://microsoftpdc.com) including the Windows Azure AppFabric Access Control Service, Caching Service, and the Service Bus.

image

Some of the specific changes with the December update of the training kit include:

  • [Updated] All demos were updated to the Azure SDK 1.3
  • [New demo script] Deploying and Managing SQL Azure Databases with Visual Studio 2010 Data-tier Applications
  • [New presentation] Identity and Access Control in the Cloud
  • [New presentation] Introduction to SQL Azure Reporting
  • [New presentation] Advanced SQL Azure
  • [New presentation] Windows Azure Marketplace DataMarket
  • [New presentation] Managing, Debugging, and Monitoring Windows Azure
  • [New presentation] Building Low Latency Web Applications
  • [New presentation] Windows Azure AppFabric Service Bus
  • [New presentation] Windows Azure Connect
  • [New presentation] Moving Applications to the Cloud with VM Role

Give it a try today!

In addition to the training kit, we have updated the Windows Azure Platform Training Courses on MSDN.

The Windows Azure Platform Training Course includes a comprehensive set of hands-on labs and videos that are designed to help you quickly learn how to use Windows Azure, SQL Azure, and the Windows Azure AppFabric. This release provides new and updated hands-on labs for the Windows Azure November 2010 release and the Windows Azure Tools for Microsoft Visual Studio 1.3. Some of these new hands-on labs demonstrate how to use new Windows Azure features such as Virtual Machine Role, Elevated Privileges, Full IIS, and more. This release also includes hands-on labs that were updated in late October 2010 to demonstrate some of the new Windows Azure AppFabric services that were announced at the Professional Developers Conference (http://microsoftpdc.com) including the Windows Azure AppFabric Access Control Service, Caching Service, and the Service Bus.

image

Setting Up the BidNow Sample Application for Windows Azure

Update: Recent updates to the Windows Azure AppFabric CTP (see here) have made some of the steps shown in this video incorrect.  Please review Getting Started with BidNow and Deploy BidNow to the Cloud for updates.

Get Microsoft Silverlight

This video provides a walkthrough of the steps required to get the BidNow Sample up and running on your computer.

BidNow is an online auction site that shows how our comprehensive set of cloud services can be used to develop a highly scalable consumer application.  We have recently released a significant update that increases BidNows use of the Windows Azure platform, and specifically uses new features announced at the Professional Developers Conference and in the Windows Azure SDK 1.3 release.

BidNow uses the following technologies:

  • Windows Azure (updated for Windows Azure SDK 1.3)
  • SQL Azure
  • Windows Azure storage (blobs and queues)
  • Windows Azure AppFabric Caching
  • Windows Azure AppFabric Access Control
  • OData
  • Windows Phone 7

For a more comprehensive discussion please see the post Signficant Updates Released in the BidNow Sample for Windows Azure.  To get the latest version of BidNow, download the sample here.  To see a live version running, please go here.