July, 2009

  • Cloudy in Seattle

    Working with Multiple Web and Worker Roles

    • 6 Comments

    After you install the July 2009 CTP and create a new project via File | New Project | Cloud Service, you now have a single template “Cloud Service” instead of the 4 you had in the past.

    Clicking on that brings up our new project creation dialog. 

    image

    There are a couple of reasons we have this dialog:

    1. In the past, we only allowed you to have 0 or 1 Web Roles and 0 or 1 Worker roles in your Cloud Service.  Now you can have 0 to N of either type.  We want to help you create the Service Model you want to have.
    2. We want to expose multiple templates for you to use for each of the Roles.  For example, we’re working to one day have an MVC Web Role, Dynamic Data Web Role and more.  We not only want you to create the Service Model you want to have but also using a selection of different templates for each Role.

    You can add Web and Worker Roles to the Cloud Service solution, rename the projects and hit OK to create the Cloud Service.  Try adding 2 Web Roles and 2 Worker Roles.

    image

    You’ll have a solution that matches:

    image

    Note that you’ll want to setup the port numbers for your input endpoints in the ServiceDefinition.csdef. 

    We auto-generate what we hope to be safe numbers but don’t know what your intention is for each of the Web Roles – at this point in time, a second or third Web Role cannot be assigned to a sub domain, they can only be differentiated by port.

    When you hit F5, we’ll bring up a web browser instance for each of the Web Roles. 

    If you don’t want us to bring up a Web Browser instance for a given web role, right click on the associated Role under the Roles node and deselect “Launch Browser”.

    image

    Also note that when you close one web browser, your debugging session will end.

  • Cloudy in Seattle

    Associating an ASP.NET Web Application (including MVC) as a Web Role

    • 1 Comments

    For more recent information on using ASP.NET MVC with Windows Azure please see this post.

    If you’ve been following along, you’ll remember my post about using an existing ASP.NET Web Application as a Web Role.  We’re now a little smarter in the tools and can allow you to associate any ASP.NET Web Application in the Cloud Service as a Web Role. 

    For example, I can create a Cloud Service with just a Worker role, right click on the Solution in Solution Explorer and select Add | New Project and select an ASP.NET Web Application from the Web folder. 

    image

    This could be *any* ASP.NET Web Application, including derivatives of it like an MVC project, Dynamic Data etc.

    For the sake of this demo, I’ll add an ASP.NET MVC Web Application:

    image 

    I then right click on the Roles node in the Cloud Service project and select Add | Web Role Project in solution…

    image

    Now instead of just “Web Roles”, you will get a list of all ASP.NET Web Application project types.  In this case, I select the MVC Web Application I created:

    image

    And there you have it, you are using a new or existing ASP.NET Web Application as a Web Role.

    (Note that if you want to use the Service Hosting runtime APIs, you’ll have to add a reference to Microsoft.ServiceHosting.ServiceRuntime.dll yourself.)

    image

    When I hit F5, I get the behavior I expect, the MVC Application running on the Windows Azure Development Fabric.

    image

    One additional note: in order for the MVC assemblies to be included in your service package that you will upload to the cloud, make sure you set the copy local property to true for the MVC DLLs (More information here):

    • System.Web.Abstractions
    • System.Web.Mvc
    • System.Web.Routing

    We hope this will make using different application types (like MVC, Dynamic Data and others) as well as using your existing ASP.NET applications easier.  Let me know what you think!

  • Cloudy in Seattle

    The Windows Azure CGI Web Role Template Explained

    • 0 Comments

    Many of you may not even know this, but as part of the Windows Azure Tools for Microsoft Visual Studio, we ship a Role template called “CGI Web Role”.

    Today, it’s a little hard to find (yes, I’m foreshadowing that this is about to change!) as you have to create a Cloud Service project first, then add/replace the Web Role with a CGI Web Role.

    For example you could create a Blank Cloud Service project:

    image

    In Solution Explorer, right click on the Roles node in the Cloud Service project Add | New Web Role Project…

    image 

    Select CGI Web Role:

    image

    Which adds an ASP.NET Web Application project tailored to be the configuration and files conduit for a FastCGI Application to your Cloud Service:

    image

    What is the purpose of the CGI Web Role? 

    Even though Visual Studio doesn’t support languages like PHP, there are reasons for you to be interested in using Visual Studio when building a FastCGI application that runs on Windows Azure:

    • Configuration:
      • Includes the Web.roleconfig file which is used to specify the FastCGI application
      • Has a commented section in the web.config that describes how to add the FastCGI handler.
    • Running on the DevFabric
      • Once you have the project setup, you can hit F5 and have your application run on the DevFabric. Stop, edit and run it again with ease.
    • Packaging for deployment
      • Right click on the Cloud Service project in the Solution Explorer and select “Publish” – this will package your application for deployment.

    Not to mention that Visual Studio really has a first class source editor and a lot of other features you’ll be able to make use of.

    (Please see the Windows Azure SDK documentation and the FastCGI sample for more information on hosting a FastCGI application on Windows Azure.)

  • Cloudy in Seattle

    Windows Azure Tools and SDK July 2009 CTP

    • 0 Comments

    I’m pleased to announce that we have released a new version of the Windows Azure Tools and SDK! (will take time to propogate, try the direct link to the download)

    What’s New for the July 2009 CTP?

    • Support for developing and deploying services containing multiple web and worker roles. A service may contain zero or more web roles and zero or more worker roles with a minimum of one role of either type.
    • New project creation dialog that supports creating Cloud Services with multiple web and worker roles.
    • Ability to associate any ASP.NET Web Application project in a Cloud Service solution as a Web Role
    • Support for building Cloud Services from TFS Build
    • Enhanced robustness and stability

    “Enhanced robustness and stability” means that we fixed some issues we’ve heard from customer feedback:

    • Invalid URI error message when trying to create Cloud Services
    • Role instances did not start with in the time allowed error message when debugging
      • Note: This can also occur when there is a problem with the security policy – please let us know if you continue to see this problem
    • Improved the error message when you run the Development Storage the first time without SQL Server Express installed which is the default DB instance to use.

    For more information on using the new features, please see the following posts:

    Working with Multiple Web and Worker Roles

    Associating an ASP.NET Web Application (including MVC) as a Web Role  

Page 1 of 1 (4 items)