# ExAzure

Azure wrapper for Elixir using [:erlazure](

## Installation

1. Add [`:ex_azure`]( to your list of dependencies in `mix.exs`:

  def deps do
    [{:ex_azure, "~> 0.1.0"}]

2. Ensure `ex_azure` is started before your application:

  def application do
    [applications: [:ex_azure]]

3. By default, ExAzure using the following configuration:

  config :ex_azure,
      account:    System.get_env("AZURE_ACCOUNT"),
      access_key: System.get_env("AZURE_ACCESS_KEY")

## Usage

For now, the ExAzure is a simple wrapper to make the calls to the `erlazure`.
This way, you can just use `ExAzure.request/3` or `ExAzure.request!/3`  to make the calls.

Access ["Implemented API functions"]( in `:erlazure` to all implemented functions.


# get a list of containers
 %{body: [{:blob_container, 'uploads', [],
     [last_modified: 'Tue, 05 Jul 2016 17:15:12 GMT',
      etag: '"0x8D3A4F7ECC4541F"', lease_status: :unlocked,
      lease_state: :available], []}], headers: [next_marker: []]}}

# get a list of blobs in "uploads" container
ExAzure.request(:list_blobs, ["uploads"])
{:ok, %{body: [], headers: [next_marker: []]}}

example of errors:

# no matched function
 %UndefinedFunctionError{arity: 1, function: :list_blobs, module: :erlazure,
  reason: nil}}

# raised error using request!/3
** (UndefinedFunctionError) function :erlazure.list_blobs/1 is undefined or private. Did you mean one of:

      * list_blobs/2
      * list_blobs/3
      * list_blobs/4

    (erlazure) :erlazure.list_blobs(#PID<0.134.0>)
    (ex_azure) lib/ex_azure.ex:43: ExAzure.do_request/3

## Test

1. Getting your `AZURE_ACCOUNT` and `AZURE_ACCESS_KEY` in ( ) and adding to `.env` file:

  echo "AZURE_ACCOUNT=value" >> .env
  echo "AZURE_ACCESS_KEY=value" >> .env

  > see [`.env.sample`](./env.sample) for example.

2. run tests

  azk shell -t -- mix do deps.get
  azk shell -t -- mix test

# Contributing

1. Fork it ( )
2. Create your feature branch (git checkout -b feature/new_feature_name)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin feature/new_feature_name)
5. Create a new Pull Request


- [ ] Add more docs:
- [ ] Add clients to a syntaxe more elegant and greater flexibility:

  # use
  # instead of
  ExAzure.request(:list_blobs, ["uploads"])
- [ ] Add CI