Azure SDK for Rust

An unofficial, idiomatic Microsoft Azure SDK for Rust

With full async/await support!

Fork me on GitHub

Why

Why

Microsoft Azure is one of the lead cloud computing platforms. Rust is one of the most promising languages of the last decade. So why not use them both? Microsoft Azure exposes every functionality via a well written REST API. While excellent, these APIs can be enhanced by exploting Rust’s great type system.

This SDK helps to hide the more complex (and boring) parts using a strongly-typed interface. We use the builder pattern wherever possibile to move the checks at compile time.

Usage

Usage

Usage is very simple with Cargo. For example, in order to connect to Azure blob storage, just put this line in your Cargo.toml and you are ready to go:

azure_sdk_storage_blob = "0.30.0"

For starters, this is how you retrieve the contents of a blob:

1
2
3
4
5
6
7
8
9
10
11
12
let client = Client::new("your_storage_account", "your_master_key")?;

let response = client
    .get_blob()
    .with_container_name("mycontainer")
    .with_blob_name("myblob.txt")
    .finalize()
    .await?;

let s_content = String::from_utf8(response.data)?;

println!("myblob.txt contents are == {}", s_content);

You will find lots of examples in the blob storage, service bus and Cosmos DB example folders. If you find that something is missing/obscure please open an issue and I will happily expand the example section.

Collaborate

Collaborate

The source code for the Azure SDK for Rust along with samples are all available on this GitHub site, and use the Apache 2.0 Open Source License. The documentation is generated by Doc.rs.

If you want to help, please do! No formality is required: just fork and ask for a pull or just open an issue. Please note that submitting a PR you relinquish your code as per the Apache 2.0 Open Source License.

Disclaimer

Disclaimer

Although I am a Microsoft employee, this is not a Microsoft endorsed project. It’s simply a pet project of mine: I love Rust (who doesn’t?) and Microsoft Azure technologies so I thought to close the gap between them. It’s also a good project for learning Rust.