Search Wiki:

Description

This project provides a Windows Azure worker role which serves web content by launching Hosted Web Core. This gives you the basic functionality of a web role, but with the flexibility to tweak advanced IIS settings, run multiple applications and virtual directories, serve web content off of a Windows Azure Drive, and more.

By running HWC yourself, you’re taking responsibility for a lot of things that are completely abstracted and automated away in the existing Windows Azure web role. Use this code only if you’re comfortable managing your own IIS configuration files and debugging HWC errors.

Blob Sync Instructions

Use the prebuilt package:
  1. Download HWCWorker_blobsync_prebuilt.zip and unzip it.
  2. Edit the configuration settings in ServiceConfiguration.cscfg. (See info about the required machineKey setting below. You must also use a cloud storage account and key.)
  3. Deploy the package and configuration to Windows Azure.
  4. Copy the content of your website to the blob container you specified in ServiceConfiguration.cscfg.
Get the source code:
  1. Download HWCWorker_blobsync_source.zip and hack away. The code's very simple.

Read my blog post "Update Your Windows Azure Website in Just Seconds by Syncing with Blob Storage" for more information.

Drive Instructions

  1. Download HWCWorker_drive_source.zip, unzip, and build it.
  2. Create a VHD using createvhd.cmd, and put your website content in it.
  3. Unmount the VHD using unmountvhd.cmd.
  4. Upload the VHD to your cloud storage account using UploadAndSnapshot.exe.
  5. Edit the configuration settings in ServiceConfiguration.cscfg, using your storage account and the snapshot URL returned from the previous step. (See info about the required machineKey setting below.)
  6. Deploy the application to Windows Azure.

Read my blog post "Serving Your Website From a Windows Azure Drive" for more information.

General Usage Instructions

  1. Edit applicationHost.config with any custom settings you want.
  2. Edit web.config with any custom settings you want.
  3. Add your web content under the "Websites" folder. (Unload and reload the worker role project to pick up the changes.) What you put in the "Websites" folder should be the same sort of thing you would copy onto an IIS server. (There should typically be a web.config file in the root of the "Websites" folder.)
  4. Configure the machineKey setting with your ASP.NET machineKey XML. You can generate an XML element with the ASP.NET machineKey Generator. This is required if you're going to be using ASP.NET Web Forms.
  5. (optional) Change the sizes in the LocalResources element of ServiceDefinition.csdef (or via the Visual Studio configuration UI).

PHP Instructions

If you're interested in using PHP, be sure to download HWCWorker_php_source.zip, which has an appropriate applicationHost.config with the recommended PHP FastCGI settings per Using FastCGI to Host PHP Applications on IIS 7, as well as a sample web.config.

You'll need to put a copy of PHP in the folder called "php". (You can download the latest PHP binaries from php.net. Just as with the "Websites" folder, be sure to unload and reload the project to pick up changes.

Running the HWC Worker

You can run the solution like any Windows Azure cloud service, but note that because everything is in a worker role, Visual Studio won't open the browser automatically. You'll need to open the browser and navigate to the appropriate link. csrun /status is your friend to find out on which port your application is running.

Nothing special is required to deploy the solution to Windows Azure.
Last edited May 15 2010 at 5:05 AM  by smarx, version 11
Updating...
Page view tracker