Add LICENSE and README files for project documentation
This commit is contained in:
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Sławomir Koszewski
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
69
README.md
Normal file
69
README.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# 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.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Any system that supports fairly recent versions of Node.js (LTS vesions are recommended).
|
||||
- A Bash shell (a Linux or macOS system or Windows with WSL2 installed).
|
||||
- Docker Community Edition or Docker Desktop (for running the emulator in a containerized environment).
|
||||
- Apple `container` command (for running the containerized version of the emulator on macOS).
|
||||
|
||||
## Native Installation
|
||||
|
||||
To install the Azure Storage Emulator natively on your machine, follow these steps:
|
||||
|
||||
1. Clone the repository:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/azure/azurite
|
||||
```
|
||||
|
||||
2. Navigate to the cloned directory:
|
||||
|
||||
```bash
|
||||
cd azurite
|
||||
```
|
||||
|
||||
3. Build the emulator package.
|
||||
|
||||
```bash
|
||||
npm ci
|
||||
npm run build
|
||||
npm pack
|
||||
```
|
||||
|
||||
4. Install the package globally using npm:
|
||||
|
||||
```bash
|
||||
npm install -g azurite-*.tgz
|
||||
```
|
||||
|
||||
5. Remove the clone directory, it will not be needed anymore:
|
||||
|
||||
```bash
|
||||
cd ..
|
||||
rm -rf azurite
|
||||
```
|
||||
|
||||
## Running the Emulator
|
||||
|
||||
There are two ways to run the Azure Storage Emulator: as a development server exposing the API on localhost using high ports (10000-10002) or as a fake Azure Storage service. The first one is easy, just run the `azurite` command in your terminal and that's it. The second one is a bit more complex, but it allows you to use the emulator as if it were the real Azure Storage service, and connect to it applications that do not support custom endpoints (Terraform azurerm state storage backend for example).
|
||||
|
||||
Run the `make-certs.sh` script to generate a self-signed CA certificate and a server certificate signed by that CA. The server certificate will be used by the emulator to serve HTTPS traffic, and the CA certificate can be imported into your system's trusted root certificates store to avoid security warnings when connecting to the emulator.
|
||||
|
||||
The `make-certs.sh` script will create a storage directory for the emulator and place the generated PEM files there. The script will create a certificate for the `terraform.blob.core.windows.net`. You can change that. You will also need to map that name to `127.0.0.1` in your hosts file.
|
||||
|
||||
```
|
||||
127.0.0.1 terraform.blob.core.windows.net
|
||||
```
|
||||
|
||||
Next, create an empty `accounts.env` file in the same directory. This file will be used by the emulator to retrieve the storage accounts names and access keys. You can use a single key or a pair of keys for each account. The format of the file is as follows:
|
||||
|
||||
```shell
|
||||
AZURITE_ACCOUNTS="account1:key1,key2;account2:key1,key2;..."
|
||||
```
|
||||
|
||||
Use `add-account.sh` script to add at least one account to the `accounts.env` file. The script will generate random key for each added account. You can use `list-accounts.sh` script to list all accounts and their keys. You can also specify a password that will be used as the value for the key. The key is always Base64 encoded, and you password will also be Base64 encoded before being stored in the `accounts.env` file. The benefit of using a password is that the account key will be deterministic, so you can easily recreate the same account with the same key if needed.
|
||||
|
||||
Finally, run the emulator using the `run-emulator.sh` script.
|
||||
Reference in New Issue
Block a user