2 out of 8 rated this helpful - Rate this topic

Configuring and Using the Storage Emulator with Visual Studio

The Windows Azure SDK development environment includes the storage emulator, a utility that simulates the Blob, Queue, and Table services available in Windows Azure on your local development machine. If you are building a cloud service that employs the Windows Azure storage services, or writing any external application that calls the storage services, you can test your code locally against the storage emulator. The Windows Azure Tools for Microsoft Visual Studio integrate management of the storage emulator into Visual Studio. The Windows Azure Tools initialize the storage emulator database on first use, start the storage emulator service when you run or debug your code from Visual Studio, and provide read-only access to the storage emulator data via the Windows Azure Storage Explorer.

For detailed information on the storage emulator, including system requirements and custom configuration instructions, see Overview of the Windows Azure Storage Emulator in the Windows Azure SDK.

noteNote
There are some differences in functionality between the storage emulator simulation and the Windows Azure storage services. See Differences Between the Storage Emulator and Windows Azure Storage Services in the Windows Azure SDK documentation for information on the specific differences.

Configuring a Connection String for the Storage Emulator

To access the storage emulator from code within a role, you will want to configure a connection string that points to the storage emulator and that can later be changed to point to a Windows Azure storage account. A connection string is a configuration setting that your role can read at runtime to connect to a storage account. For more information about how to create connection strings, see Configuring a Windows Azure Project.

noteNote
You can return a reference to the storage emulator account from your code by using the DevelopmentStorageAccount property. This approach works correctly if you want to access the storage emulator from your code, but if you plan to publish your application to Windows Azure, you will need to create a connection string to access your Windows Azure storage account and modify your code to use that connection string before you publish it. If you are switching between the storage emulator account and a Windows Azure storage account frequently, a connection string will simplify this process.

Initializing and Running the Storage Emulator

You can specify that when you run or debug your service in Visual Studio, Visual Studio automatically launches the storage emulator. In Solution Explorer, open the shortcut menu for your Windows Azure project, and choose Properties. On the Development tab, in the Start Windows Azure Storage Emulator list select True.

The first time you run or debug your service from Visual Studio, the storage emulator launches an initialization process. This process reserves local ports for the storage emulator and creates the storage emulator database. Once complete, this process does not need to run again unless the storage emulator database is deleted.

noteNote
Starting with the June 2012 release of the Windows Azure Tools, the storage emulator runs, by default, in SQL Express LocalDB. In earlier releases of the Windows Azure Tools, the storage emulator runs against a default instance of SQL Express 2005 or 2008, which you must install before you can install the Windows Azure SDK. You can also run the storage emulator against a named instance of SQL Express or a named or default instance of Microsoft SQL Server. If you need to configure the storage emulator to run against an instance other than the default instance, see How to Configure SQL Server for the Storage Emulator.

The storage emulator provides a user interface to view the status of the local storage services and to start, stop, and reset them. Once the storage emulator service has been started, you can display the user interface or start or stop the service by right-clicking on the notification area icon for the Windows Azure Emulator in the Windows taskbar.

Viewing Storage Emulator Data with the Windows Azure Storage Explorer

The Windows Azure Storage Explorer is an extension to the Server Explorer window that is available as part of the Windows Azure Tools for Visual Studio. The Storage Explorer provides read-only access to blob and table data in your storage accounts, including the storage emulator. For more information, see Browsing Storage Resources with Server Explorer.

See Also

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.
facebook page visit twitter rss feed newsletter