Gaurav Mantri's Personal Blog.

Managing Storage Emulator in Azure SDK Version 2.3

Yesterday (3rd of April), a new version of Azure SDK (version 2.3) was released. Being an Azure Fanboy ๐Ÿ™‚ (and not to mention serious Azure developer) I went ahead and downloaded this new SDK and converted my cloud services project to make use of this latest version of SDK.

While doing development, I needed to reset my development storage account. Obviously, I fired up Azure SDK Command Prompt and executed โ€œDSInit /forceCreateโ€ command (after all I have been using this for ages now), but to my surprise I was greeted with โ€œFile Not Foundโ€ error.

image

With SDK 2.3, Azure SDK team got rid of โ€œDSInit.exeโ€ application and instead the new application for Storage Emulator is โ€œWAStorageEmulator.exeโ€ which can be found in โ€œC:\Program Files (x86)\Microsoft SDKs\Windows Azure\Storage Emulatorโ€. Another thing the team did was that they got rid of the user interface for the storage emulator and all we have now is a command line interface.

So if you want to reinitialize the Storage Emulator, open command prompt (no admin privileges needed) and run the following command there:

WAStorageEmulator init -forcecreate

This will delete the existing database and create a new database for you and you will get a clean local storage emulator. When running this command, please make sure that the storage emulator is not running.

However, the goodness doesnโ€™t stop there :). Letโ€™s say you want to only delete tables from local storage emulator. Well, what do you know โ€“ youโ€™re in luck! Now it is possible to clear only certain storage components of local storage emulator without having to go through the process of recreating the database.

To remove just tables, this is the command you would need to run:

WAStorageEmulator clear table

To remove just blob containers, this is the command you would need to run:

WAStorageEmulator clear blob

To remove just queues, this is the command you would need to run:

WAStorageEmulator clear queue

To remove all tables, blob containers and queues, this is the command you would need to run:

WAStorageEmulator clear all

Note: You have to specify โ€œallโ€ parameter. You can’t omit it.

Other commands available to you are:

Start: Starts the storage emulator.

Stop: Stops the storage emulator.

Status: Gets current status of the emulator.

Hope this helps!


[This is the latest product I'm working on]