# `IMDS.Providers.Azure`

Azure Instance Metadata Service (IMDS).

Every request sends `Metadata: true`. Requests use API version `2021-02-01`
unless the `:api_version` option gives another value. `request/3` adds the
`api-version` query parameter when the path does not hold one. The raw
identity map contains the complete Azure metadata document, including the
network fields.

# `api_version`

```elixir
@spec api_version(keyword()) :: binary()
```

Return the API version used for requests.

# `path`

```elixir
@spec path(keyword()) :: binary()
```

Return the metadata path of the API version in `opts`.

## Examples

    iex> IMDS.Providers.Azure.path([])
    "/metadata/instance?api-version=2021-02-01&format=json"

    iex> IMDS.Providers.Azure.path()
    "/metadata/instance?api-version=2021-02-01&format=json"

# `private_ipv4`

```elixir
@spec private_ipv4(map()) :: binary() | nil
```

Return the first private IPv4 address in an Azure metadata document.

## Examples

    iex> document = %{"network" => %{"interface" => [%{"ipv4" => %{"ipAddress" => [%{"privateIpAddress" => "10.0.0.4"}]}}]}}
    iex> IMDS.Providers.Azure.private_ipv4(document)
    "10.0.0.4"

    iex> IMDS.Providers.Azure.private_ipv4(%{})
    nil

---

*Consult [api-reference.md](api-reference.md) for complete listing*
