Skip to content

Commit 59106e5

Browse files
committed
Instructions
1 parent 7db1dca commit 59106e5

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,42 @@ prod:
4646
principal_id: 71b34410-4c50-451d-b456-95ead1b18cce
4747
```
4848

49+
### Azurite
50+
51+
To use Azurite, pass the `storage_blob_host` config key with the Azurite URL (`http://127.0.0.1:10000/devstoreaccount1` by default)
52+
and the Azurite credentials (`devstoreaccount1` and `Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==` by default).
53+
54+
Example:
55+
56+
```
57+
dev:
58+
service: AzureBlob
59+
container: container_name
60+
storage_account_name: devstoreaccount1
61+
storage_access_key: "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
62+
storage_blob_host: http://127.0.0.1:10000/devstoreaccount1
63+
```
64+
65+
You'll have to create the container before you can start uploading files.
66+
You can do so using Azure CLI, Azure Storage Explorer, or by running:
67+
68+
69+
```
70+
bin/rails runner "
71+
container_name = 'CONTAINER_NAME_REPLACE_ME'
72+
require %{azure_blob}
73+
AzureBlob::Client.new(
74+
account_name: %{devstoreaccount1},
75+
access_key: %{Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==},
76+
host: %{http://127.0.0.1:10000/devstoreaccount1},
77+
container: container_name)
78+
.tap{|container| container.create_container unless container.get_container_properties.present?}
79+
.tap{|container| puts 'done!' if container.get_container_properties.present?}"
80+
```
81+
82+
Replace `CONTAINER_NAME_REPLACE_ME` with your container name.
83+
Container names can't have any special characters, or you'll get an error.
84+
4985
## Standalone
5086

5187
Instantiate a client with your account name, an access key and the container name:

0 commit comments

Comments
 (0)