'How to clear Azure Storage Emulator Data from command line?
My solution is using Azure Emulator. I would like to clear the Azure Storage Emulator Blobs, Queues and Tables without having to perform manual actions. I need to be able to do it from command line, preferably PowerShell.
Server Explorer in Visual Studio 2015, Azure-node:
AzureStorageEmulator.exe help returns the following commands:
- AzureStorageEmulator.exe init: Initialize the emulator database and configuration.
- AzureStorageEmulator.exe start: Start the emulator.
- AzureStorageEmulator.exe stop: Stop the emulator.
- AzureStorageEmulator.exe status: Get current emulator status.
- AzureStorageEmulator.exe clear: Delete all data in the emulator.
- AzureStorageEmulator.exe help [command]: Show general or command-specific help.
However when trying out "clear" the following is returned:
The following services have been succesfully cleared of user data: None
Solution 1:[1]
cd C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator
.\AzureStorageEmulator.exe clear all
Solution 2:[2]
Visual Studio 2022 and Azurite
it will not use SQL Server like Legacy Storage Simulator and all the related data is stored as large JSON files in the following folder
%userprofile%\AppData\Local\Temp\Azurite
- you will see Azurite services starting up in Visual Studio Service Dependencies Window when you open VS with any project that needs this

- Azure Storage Explorer Will automatically connect to this new emulator VIA REST-API and if you using Legacy Emulator and new emulator at the same time you are working with different data sets and New Azure do not use SQL server
- it seems that Azurite has to explicit stop and clear command at the moment (3.14.3) and if you cannot delete this folder just close both Visual Studio and Storage Explorer and try again.
Visual Studio 2019 and deprecated Azure Storage Emulator
Running "AzureStorageEmulator.exe clear all" & "init" command usually hangs (or may take too much time)
solution: you can go to user folder (%userprofile%) usually in the following address and delete existing AzureStorageEmulatorDb510.mdf and ldf files.(last suffix 510 stands for version 5.10 of emulator)
C:\Users\[YOUR_USER] or %userprofile%
if you can not delete them you because they are locked, stop Azure Storage Emulator by running AzureStorageEmulator.exe stop and try again or simply by shutting it down from its icon in system tray
Solution 3:[3]
An alternative approach if you are using Azurite & VS2022+ is to use VSCode Durable Functions Monitor extension to delete the hub in the emulator.
I found Purge and Clean operations (from VSCode ext.) failed against Azurite both when I ran from VS2022 or using docker. They work for me when I am using real Azure storage. This eliminates the annoyance of having to quit VS before you can delete the files.
Deleting the hub in VSCode Durable Functions Monitor is by far the quickest way I have found so far to reset everything before another debug run.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Brandon Minnick |
| Solution 2 | |
| Solution 3 | robs |


