Implementation of the Azure Blob Storage Rest API for Elixir.
Currently supports:
- Downloading blobs
- Uploading blobs
- Deleting blobs
- Stream uploading blobs
- Listing blobs
- Creating containers
- Listing containers
Available in Hex, the package can be installed
by adding azurex
to your list of dependencies in mix.exs
e.g.:
def deps do
[
{:azurex, "~> 1.1.0"}
]
end
The configuration should either define storage_account_name
and storage_account_key
or storage_account_connection_string
.
config :azurex, Azurex.Blob.Config,
api_url: "https://sample.blob.core.windows.net", # Optional
default_container: "defaultcontainer", # Optional
storage_account_name: "name",
storage_account_key: "access key",
storage_account_connection_string: "Storage=Account;Connection=String" # Required if storage account `name` and `key` not set
Each of these options is then overridable per-request, if you need to work with multiple instances:
Azurex.Blob.list_blobs(container: "other", api_uri: "https://other.blob.net")
Azurex.Blob.get_blob("file.txt", [
storage_account_connection_string: "Account=Storage;String=Connection"
])
Azurex.Blob.put_blob("file.txt", "contents", "text/plain", [
storage_account_key: "key",
storage_account_name: "name"
])
Documentation can be found at https://hexdocs.pm/azurex. Or generated using ExDoc
The goal is to support all actions in the Azure Blob Storage Rest API - PRs welcome :)