Azure Storage Emulator

This is a simple guide that will help you set up and run the Azure Storage Emulator on your local machine. The Azure Storage Emulator allows you to develop and test your applications that use Azure Storage services without needing an actual Azure subscription nor Internet connection.

Review the Documentation for more details on how to use the emulator and its features. This document will cover a scenario where you want to run the emulator as close to the real Azure Storage service as possible, which means using triple HTTPS endpoints and OAuth simulation.

Docker Installation

To run the Azure Storage Emulator in a Docker container, follow these steps:

  1. Ensure that a container runtime is installed. This repository supports both Docker and Apple container command.

  2. Build the emulator image using the provided Dockerfile:

    ./build.sh
    
  3. Run the emulator container:

    ./run.sh
    

Native Installation

To install the Azure Storage Emulator natively on your machine, follow these steps:

  1. Clone the repository:

    git clone https://github.com/azure/azurite
    
  2. Navigate to the cloned directory:

    cd azurite
    
  3. Build the emulator package.

    npm ci
    npm run build
    npm pack
    
  4. Install the package globally using npm:

    npm install -g azurite-*.tgz
    
  5. Remove the clone directory, it will not be needed anymore:

    cd ..
    rm -rf azurite
    
  6. Install the Caddy HTTP server.

  7. Create an accounts.env file in the same directory as the run-server.sh script with the following content:

    AZURITE_ACCOUNTS=accountname:accountkey
    

    Replace accountname with the desired account name. Use OpenSSL to generate an account key.

    openssl rand -base64 32
    

    You can also generate a deterministic account key using any string as a seed:

    echo -n "your-seed-string" | base64
    
  8. Add the following line to your /etc/hosts file to map the custom domain names to localhost:

    127.0.0.1 <accountname>.blob.core.windows.net <accountname>.queue.core.windows.net <accountname>.table.core.windows.net
    
  9. Run the server:

    ./run-server.sh
    

    You can add the --oauth or -o flag to simulate OAuth authentication.

    ./run-server.sh --oauth
    

Reference

Description
No description provided
Readme MIT 140 KiB
Languages
Shell 91.8%
Dockerfile 5%
HCL 3.2%