You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following command runs the Azurite Docker image. The `-p 10000:10000` parameter redirects requests from host machine's port 10000 to the Docker instance.
77
-
78
-
```console
79
-
docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 \
80
-
mcr.microsoft.com/azure-storage/azurite
81
-
```
82
-
83
-
**Specify the workspace location**:
84
-
85
-
In the following example, the `-v c:/azurite:/data` parameter specifies *c:/azurite* as the Azurite persisted data location. The directory, *c:/azurite*, must be created before running the Docker command.
86
-
87
-
```console
88
-
docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 \
docker run -p 10000:10000 mcr.microsoft.com/azure-storage/azurite \
96
-
azurite-blob --blobHost 0.0.0.0 --blobPort 10000
97
-
```
98
-
99
-
For more information about configuring Azurite at start-up, see [Command-line options](#command-line-options).
100
-
101
77
### [GitHub](#tab/github)
102
78
103
79
This installation method requires that you have [Git](https://git-scm.com/) and [Node.js version 8.0 or later](https://nodejs.org) installed. Clone the [GitHub repository](https://github.com/azure/azurite) for the Azurite project by using the following console command.
@@ -192,6 +168,24 @@ This command tells Azurite to store all data in a particular directory, *c:\azur
192
168
193
169
### [Docker Hub](#tab/docker-hub)
194
170
171
+
**Run the Azurite Docker image**:
172
+
173
+
The following command runs the Azurite Docker image. The `-p 10000:10000` parameter redirects requests from host machine's port 10000 to the Docker instance.
174
+
175
+
```console
176
+
docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 \
177
+
mcr.microsoft.com/azure-storage/azurite
178
+
```
179
+
180
+
**Specify the workspace location**:
181
+
182
+
In the following example, the `-v c:/azurite:/data` parameter specifies *c:/azurite* as the Azurite persisted data location. The directory, *c:/azurite*, must be created before running the Docker command.
183
+
184
+
```console
185
+
docker run -p 10000:10000 -p 10001:10001 -p 10002:10002 \
@@ -432,6 +426,14 @@ Azurite supports basic authentication by specifying the `basic` parameter to the
432
426
azurite --skipApiVersionCheck
433
427
```
434
428
429
+
### Disable Production Style Url
430
+
431
+
**Optional**. When using the fully-qualified domain name instead of the IP in request Uri host, by default Azurite will parse the storage account name from request Uri host. You can force the parsing of the storage account name from request Uri path by using `--disableProductStyleUrl`:
432
+
433
+
```cmd
434
+
azurite --disableProductStyleUrl
435
+
```
436
+
435
437
## Authorization for tools and SDKs
436
438
437
439
Connect to Azurite from Azure Storage SDKs or tools, like [Azure Storage Explorer](https://azure.microsoft.com/features/storage-explorer/), by using any authentication strategy. Authentication is required. Azurite supports authorization with OAuth, Shared Key, and shared access signatures (SAS). Azurite also supports anonymous access to public containers.
@@ -447,7 +449,7 @@ Azurite accepts the same well-known account and key used by the legacy Azure Sto
447
449
448
450
### Custom storage accounts and keys
449
451
450
-
Azurite supports custom storage account names and keys by setting the `AZURITE_ACCOUNTS` environment variable in the following format: `account1:key1[:key2];account2:key1[:key2];...`.
452
+
Azurite supports custom storage account names and keys by setting the `AZURITE_ACCOUNTS` environment variable in the following format: `account1:key1[:key2];account2:key1[:key2];...`.
451
453
452
454
For example, use a custom storage account that has one key:
453
455
@@ -459,6 +461,9 @@ set AZURITE_ACCOUNTS="account1:key1"
459
461
export AZURITE_ACCOUNTS="account1:key1"
460
462
```
461
463
464
+
> [!NOTE]
465
+
> The account keys must be a base64 encoded string.
466
+
462
467
Or use multiple storage accounts with two keys each:
463
468
464
469
```cmd
@@ -474,6 +479,8 @@ Azurite refreshes custom account names and keys from the environment variable ev
474
479
> [!NOTE]
475
480
> The default `devstoreaccount1` storage account is disabled when you set custom storage accounts.
476
481
482
+
The account keys must be a base64 encoded string.
483
+
477
484
### Connection strings
478
485
479
486
The easiest way to connect to Azurite from your application is to configure a connection string in your application's configuration file that references the shortcut *UseDevelopmentStorage=true*. Here's an example of a connection string in an *app.config* file:
@@ -679,14 +686,49 @@ The following URI is a valid address for a blob in an Azure Storage account:
Since the local computer doesn't do domain name resolution, the account name is part of the URI path instead of the host name. Use the following URI format for a resource in Azurite:
689
+
690
+
#### IP-style URL
691
+
692
+
Since the local computer doesn't resolve domain names, the account name is part of the URI path instead of the host name. Use the following URI format for a resource in Azurite:
Optionally, you could modify your hosts file to access an account with _production-style_ URL.
703
+
704
+
First, add one or more lines to your hosts file. For example:
705
+
706
+
```
707
+
127.0.0.1 account1.blob.localhost
708
+
127.0.0.1 account1.queue.localhost
709
+
127.0.0.1 account1.table.localhost
710
+
```
711
+
712
+
Next, set environment variables to enable customized storage accounts and keys:
713
+
714
+
```
715
+
set AZURITE_ACCOUNTS="account1:key1:key2"
716
+
```
717
+
718
+
You could add more accounts. See the [Custom storage accounts and keys](#custom-storage-accounts-and-keys) section of this article.
719
+
720
+
Start Azurite and use a customized connection string to access your account. The example connection string below assumes that the default ports are used.
Do not access default account in this way with Azure Storage Explorer. There is a bug that Storage Explorer is always adding account name in URL path, causing failures.
727
+
728
+
By default, when using Azurite with a production-style URL, the account name should be the host name in fully-qualified domain name such as "http://devstoreaccount1.blob.localhost:10000/container". To use production-style URL with account name in the URL path such as "http://foo.bar.com:10000/devstoreaccount1/container", make sure to use the `--disableProductStyleUrl` parameter when you start Azurite.
729
+
730
+
If use `host.docker.internal` as request Uri host (For example: `http://host.docker.internal:10000/devstoreaccount1/container`), Azurite will always get the account name from the request Uri path. This is true regardless of whether you use the `--disableProductStyleUrl` parameter when you start Azurite.
731
+
690
732
### Scaling and performance
691
733
692
734
Azurite doesn't support large numbers of connected clients. There's no performance guarantee. Azurite is intended for development and testing purposes.
0 commit comments