Azure Storage Emulator

If you’ve done some work with Azure then you may have wondered if it is possible to run a local version of Azure for development and testing instead of having to go to the cloud for those needs. The answer is that it’s not only possible, but (surprisingly?) easy and painless.

Azure Storage Explorer (Screenshot)

There’s a tool available from MSDN called “Azure Storage Emulator” which comes with the Azure SDK but also available in a standalone package. You can find more info on it, including the download link at this MSDN article. Seemingly this emulator is only available for Windows. To get started, install the application from the MSI package and then run it (the shortcut should be added to your start menu as “Windows Azure Storage Emulator”) . After starting it you should see a message that says “The storage emulator was successfully started.”

The emulator has only one built in account that you cannot edit, the account details are as follows:

Account name: devstoreaccount1
Account key: Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==

The connection string you would use to access your local Azure instance would be as follows:

DefaultEndpointsProtocol=https;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10001/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount1

You can query the status of your storage server by using the command “WAStorageEmulator.exe status” which should produce the URLs for your endpoints, as follows:

Windows Azure Storage Emulator 3.3.0.0 command line tool
IsRunning: True
BlobEndpoint: http://127.0.0.1:10000/
QueueEndpoint: http://127.0.0.1:10001/
TableEndpoint: http://127.0.0.1:10002/

From here on in, you’re set and should be able to start using it just like you would use a real Azure server. To verify access and manually manipulate content on your server I’d suggest using a tool like Azure Storage Explorer available here: https://azurestorageexplorer.codeplex.com/ (pictured in the screenshot at the top of this article). Note that when adding your local instance to the explorer, you have to select the “Local Developer Account” radio button and not try to change the endpoint domain to your local one when selecting “Cloud Storage Account”.

Another interesting thing to note: you can find the files on your local file system by going to %LOCALAPPDATA%\WAStorageEmulator\BlockBlobRoot where the content of your files will be stored, however all the metadata is actually stored in a SQL table so the files you see there will not have proper names like what you’d see in storage explorer. This stackoverflow thread explains in more detail.

Relevant Links:

0 Comments

Leave a Reply

Your email address will not be published.