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!

Comments

  1. Helpful Thanks a lot

  2. This is really helpful and informative. :)

    Thanks

  3. Gaurav,
    What is the difference between “WAStorageEmulator init –forcecreate” and “WAStorageEmulator clear all”.

    Thanks

    • From what I understand “init -forcecreate” parameter recreates the database. At this time you have an option of specifying other database as well. Whereas “clear all” does not drop the database. It just deletes all the tables containing storage emulator data. HTH.

Speak Your Mind

*