Var denne siden nyttig?
Din tilbakemelding på dette innholdet er viktig. Fortell oss hva du synes.
Mer tilbakemelding?
1500 tegn igjen
Eksporter (0) Skriv ut
Vis alt
Dette innholdet er ikke tilgjengelig på ditt språk, men her er den engelske versjonen.

Configuring and Using the Storage Emulator with Visual Studio

Updated: May 13, 2015

The Azure SDK development environment includes the storage emulator, a utility that simulates the Blob, Queue, and Table services available in Azure on your local development machine. If you are building a cloud service that employs the Azure storage services, or writing any external application that calls the storage services, you can test your code locally against the storage emulator. The Azure Tools for Microsoft Visual Studio integrate management of the storage emulator into Visual Studio. The 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 Azure Storage Explorer.

For detailed information on the storage emulator, including system requirements and custom configuration instructions, see Use the Azure Storage Emulator for Development and Testing.

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

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 an 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 the Azure Application.

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 Azure, you will need to create a connection string to access your 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 an Azure storage account frequently, a connection string will simplify this process.

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 Azure project and choose Properties. On the Development tab, in the Start Azure Storage Emulator list, choose True (if it isn't already set to that value).

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.

Starting with the June 2012 release of the Azure Tools, the storage emulator runs, by default, in SQL Express LocalDB. In earlier releases of the 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 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 Initialize the Storage Emulator by Using the Command-Line Tool.

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 the notification area icon for the Microsoft Azure Emulator in the Windows taskbar.

The Azure Storage node in Server Explorer enables you to view data and change settings for blob and table data in your storage accounts, including the storage emulator. See Browsing and Managing Storage Resources with Server Explorer for more information.

See Also

© 2015 Microsoft