<div align="center">
<img src="./logo.png" alt="Fetch Azure Logo" width="96">
# Fetch Azure
[](https://crates.io/crates/fetch_azure)
[](https://docs.rs/fetch_azure)
[](https://crates.io/crates/fetch_azure)
[](https://github.com/microsoft/oxidizer/actions/workflows/main.yml)
[](https://codecov.io/gh/microsoft/oxidizer)
[](../../LICENSE)
<a href="../.."><img src="../../logo.svg" alt="This crate was developed as part of the Oxidizer project" width="20"></a>
</div>
Adapt a [`fetch::HttpClient`][__link0] into an Azure SDK HTTP transport.
The Azure SDK abstracts its HTTP transport behind the
[`azure_core::http::HttpClient`][__link1] trait. [`HttpClient`][__link2] implements it on top
of a `fetch` client, so Azure SDK pipelines run over `fetch` and benefit
from its resilience and observability.
To run the Azure SDK on an `anyspawn`-backed async runtime, see the
`anyspawn_azure` crate.
## Example
```rust
use azure_core::http::{ClientOptions, Transport};
use fetch_azure::HttpClient;
// Wire a `fetch` client in as the transport for an Azure SDK client.
let transport = Transport::new(HttpClient::from(client).into());
let options = ClientOptions {
transport: Some(transport),
..Default::default()
};
```
<hr/>
<sub>
This crate was developed as part of <a href="../..">The Oxidizer Project</a>. Browse this crate's <a href="https://github.com/microsoft/oxidizer/tree/main/crates/fetch_azure">source code</a>.
</sub>
[__cargo_doc2readme_dependencies_info]: ggGmYW0CYXZlMC43LjJhdIQbLiTyV0MU86EbZU15e0PmecoboQ9jo59bnAEbyDXw04U13GlhYvRhcoQbbmImiFehOUcbSWj7AJ0Zo0QbEU03KDZjzxUbIR9apRz2JO5hZIOCamF6dXJlX2NvcmVlMS4wLjCCZWZldGNoZjAuMTIuMoJrZmV0Y2hfYXp1cmVlMC4yLjI
[__link0]: https://docs.rs/fetch/0.12.2/fetch/?search=HttpClient
[__link1]: https://docs.rs/azure_core/1.0.0/azure_core/?search=http::HttpClient
[__link2]: https://docs.rs/fetch_azure/0.2.2/fetch_azure/?search=HttpClient