Updated April 14, 2023
What is Azure Storage Emulator?
Microsoft’s Azure Storage Emulator is a technology that imitates the Azure Queue, Table, and Blob services for the determination of local improvement. Using the Storage Emulator, one can check their application beside the storage services locally but is deprived of building a subscription or sustaining any costs. If one is gratified having how the application is operating in the emulator, shift to implementing a storage account prevailing in the cloud.
However, currently, this Storage Emulator is deplored, and therefore, Microsoft suggests that users implement the Azurite emulator with Storage for local development as Azurite surpasses the Storage Emulator. Thus, to upkeep the modern versions of Storage APIs, this Azurite will remain to be updated.
Using Azure Storage Emulator
- The Storage Emulator is accessible as a section of the Microsoft Azure SDK. One can also configure the Storage Emulator through the standalone installer or by a direct download, but you should possess administrative rights on the system. Presently, the Storage Emulator runs on OS Windows only however, to use emulation on OS Linux, we need to install the Azurite emulator.
- The storage emulator implements a local Microsoft SQL Server 2012 Express LocalDB occurrence for emulating services of storage. You can select to set up the Storage Emulator for accessing a local occurrence of SQL server as a substitute for the LocalDB instance.
- The Storage Emulator associates either to SQL Server or to LocalDB by means of Windows confirmation. There are a few differences in terms of functionality that prevail between the storage services and the Storage Emulator.
- Now, for starting and initializing this storage emulator, firstly, we need to choose the Start option, or also we can enter the Windows key, again, you should type the name Storage Emulator and next choose the emulator displayed from the list of applications.
- After the emulator begins, you will see a Command Prompt window. The console window can be used either to start or to halt the Storage Emulator. Here, from the command prompt, one can even get status, clear data, and initialize the emulator. If another storage emulator is executing on the computer, then the storage emulator cannot begin properly. You can view an icon when the storage emulator is being run in the Windows taskbar notification region.
Azure Storage Emulator Tools
- Storage Emulator possesses a command-line tool orientation. Beginning with version 3.0, when the Storage Emulator is started, a console window will be displayed. We need to implement the command line available in the console window for starting and stopping the storage emulator.
- This command-line tool is useful for getting status by using query commands and also performing other operations by typing in the command line.
- It should be noted that when there is Microsoft Compute Emulator configured on the system, then you will see a system tray icon appearing if the Storage Emulator is launched. By right-clicking on the icon, we can reveal a menu that offers a graphical way to begin and end the Storage Emulator.
- We have the following simple syntax for the command-line tool used for the storage emulator operations with a list of options:
AzureStorageEmulator.exe [start][status][stop][init][clear][help]
Descriptions:
Start: For starting up the Emulator.
Status: For publishing the status of the Storage Emulator.
Stop: For halting the emulator.
Clear: For removing the data info present in the services, such as blob, table, queue, and all options, indicated on the command line.
Init: Performs one-time initialization to configure the storage emulator.
Help: We need to script /help at the command prompt for displaying the list of options for Storage Emulator operations.
Running Azure Storage Emulator
- The Storage Emulator is determined by particular versions of the OData libraries. Substituting the OData DLLs that are implemented by the Storage Emulator having additional versions available is unconfirmed and even may root for unpredicted behavior. But any OData version provisioned by the storage service can be applied to conduct requests to the storage emulator.
- The Storage Emulator uses Windows verification to connect the LocalDB or SQL server. You can select to install the emulator for accessing either a local Microsoft SQL Server instance or the LocalDB instance.
We will run Azure Storage Emulator by the following initialization steps:
1. You can download the emulator by the link here.
2. Start the setup and initialize the storage emulator.
3. After that, you can either choose the start button or enter the Windows key.
4. Then type the name Storage Emulator.
5. Here, choose the emulator from the list of shown applications.
- On starting the Storage Emulator, a command prompt window is displayed. This console window can be applied to start and end the Storage Emulator. If another emulator named Azurite is installed on the system, then the Storage Emulator may not work properly.
- You will view an icon present in the Windows taskbar notification region when the Storage Emulator runs on the system. On closing the command prompt window of the Storage Emulator, the emulator will not be closed it still runs. Now, if again we want to bring up the console window of the storage emulator, you can succeed in the previous steps as if beginning the storage emulator.
- On running the storage emulator for the initial time, then the local storage environment is prepared for the user. This preparation procedure designs a database in LocalDB along with keeping HTTP ports for every local storage service.
- Here, the storage emulator is configured by default to the system path as c:\Program Files (x86)\Microsoft SDKS\Azure\Storage Emulator.
- The user can implement the Microsoft Azure Storage Explorer for working with the local storage Emulator resources.
How to clear Azure Storage Emulator
- The Storage Emulator offers unrestricted local development. It gives options to clear data, receive status and also prepare the emulator in Azure from the command prompt. One can also implement the (SSMS) Microsoft SQL Server management studio to a few storage client libraries, like only the Xamarin library.
- Command-line tool option in the console window can be used to start and end the emulator and its related operations. Also, we can perform queries for status and other operations too from the command line. Therefore, we can apply the clear command from the command shell to execute and clear the data records found in all services identified on the command line. The syntax command used can be written as: AzureStorageEmulator.exe clear [blob] [table] [queue] [all].
- Here, the options added after the clear command define that: blob will clear the data off the blob, a table will remove the data of the table, the queue will remove the data of queue, and at last f we use all, it will clear the entire data present in all services.
Conclusion
Azure Storage Emulator has the provision of just a fixed account with a well-identified authentication key. This emulator does not operate as a scalable storage device for supporting a huge number of concurrent clients. The Emulator can support blob sizes only up to 2GB. While data developed in one version of the emulator may not be confirmed to be obtainable when applying a varied version.
Recommended Articles
This is a guide to Azure Storage Emulator. Here we discuss What is Azure Storage Emulator, how to use its tools, and How to clear Azure Storage Emulator. You may also have a look at the following articles to learn more –