The development fabric simulates the Windows® Azure™ fabric on your local computer so that you can run and test your service locally before deploying it. The development fabric allows you to debug and fine-tune the behavior of your service before it is deployed. It provides a user interface for observing and managing local service deployments.
There are a few differences between the development environment and Windows Azure that may affect how your service runs in one or the other. For more information, see Differences Between the Development Fabric and Windows Azure.
Packaging a Service for the Development Fabric
To deploy a service in the development fabric, you must first package the service in the appropriate format. To package a service for the development fabric, call the CSPack command-line tool with the /copyonly option. This option copies the service binaries to a directory layout from which they can be run in the development fabric.
By convention, the default name for the directory created by CSPack ends in the .csx extension, but you can choose a different name for this directory.
Note that when you package a service for deployment to the cloud, you create a file package rather than a directory structure. The directory structure is for deployment to the development fabric only.
For more information about the CSPack command-line tool, see CSPack Command-Line Tool.
Deploying a Service to the Development Fabric
After you have packaged your service and started development storage, call the CSRun command line tool to deploy the service to the development fabric and start development storage. For more information about using CSRun, see CSRun Command-Line Tool.
Calling CSRun starts the development fabric if it is not yet running. When the fabric starts up, a system tray icon appears. You can right-click this icon to display the user interfaces for the development fabric and development storage and to start or shut down these services.
Note that calling CSRun requires administrative privileges. If you are not calling CSRun from an elevated command prompt, you'll be prompted with two User Access Control (UAC) prompts each time you start up the developer fabric.
To launch an additional service deployment to the development fabric, call CSRun again. Each deployment appears in the developer fabric UI. Note that the development fabric UI does not support launching additional service deployments.
To update the service configuration, call CSRun with the /update option and the path to the new service configuration file.
HTTP Endpoints in the Development Fabric
Within your service definition file, you must specify a port number for each external endpoint defined for your service. For a service running in the Windows Azure fabric, this port number is allocated with a unique IP address.
In the development fabric, it's not possible to allocate a unique IP address. The development fabric will attempt to assign the requested port. If that port is not available, it will allocate the next best available port number. This means that in the development fabric, your service may be assigned a different port number from the one that you specified in the service definition file.
Using the Development Fabric UI
The development fabric UI shows your service deployments in an interactive format. You can examine the configuration of a service, its roles, and its role instances. From the UI, you can run, suspend, or restart a service. In this way, you can verify the basic functionality of your service.
To display the development fabric UI, right-click the Windows Azure Simulation Monitor icon in the Windows taskbar or notification area, and choose Show Development Fabric UI.
Debugging with the Development Fabric
The development fabric UI enables you to debug your service locally. In this way, you can ensure that the service runs as expected in the development fabric and that the logging information that your code is writing will be adequate for diagnosing problems when the service is running in the cloud.
To attach a debugger to a role running in the development fabric, right-click the role beneath the desired deployment in the left-hand pane of the development fabric UI and then click Attach Debugger. To configure the default debugger that the development fabric will attach to, display the development fabric UI, and then click Options from the Tools menu. Configure debugger information on the Attach Debugger tab.
Logging and Diagnostics
The development fabric UI enables you to view logging and diagnostic information as it is being written to the Windows Azure logs, and change the threshold level for logging, so that only messages flagged at the specified level or above are displayed in the logs. To change the threshold level for logging for a role instance, display the role instance in the development fabric UI, and right-click on the right-hand pane. From the shortcut menu, choose Logging Level, then indicate the level at which to display messages. All messages at that level and higher (i.e., more severe) will be displayed in the output window.
The UI only displays the logs from the time it was launched, not from the time that the developer fabric was launched. To display logging information before the UI was launched, including startup information, call CSRun with the /dumplogs option.
Opening a Local Store
A local storage resource is a reserved directory location that may be used for caching data and writing logging and diagnostic information. You can also view this directory from the development fabric by clicking Open Local Store from the Tools menu.
See Also