This directory contains the source code, examples and tests for the Azure IoT Operations Rust SDK.
The following Azure IoT Operations crates are available:
| Crate | API | Description |
|---|---|---|
| azure_iot_operations_mqtt | 🔗 | MQTTv5 client library for decoupled asynchronous applications |
| azure_iot_operations_protocol | 🔗 | Utilities for using the Azure IoT Operations Protocol (RPC, Telemetry) |
| azure_iot_operations_services | 🔗 | Clients for using services of Azure IoT Operations |
| azure_iot_operations_connector | 🔗 | Library and Traits for building Azure IoT Operations Connectors |
-
To set up your cluster and install Azure IoT Operations, refer to the setup guide
-
Check out the available Rust samples
-
Read through Deploy the application for building and deploying the container to your K8s cluster
We recommend using Ubuntu or Debian for developing your applications. The instructions below may require modifications for other Linux distributions.
-
Install the SSL toolkit:
sudo apt-get install libssl-dev pkg-config
-
Add the crates you wish to use to your application's
Cargo.toml:[dependencies] azure_iot_operations_mqtt = { version = "<version>" } azure_iot_operations_protocol = { version = "<version>" } azure_iot_operations_services = { version = "<version>" } azure_iot_operations_connector = { version = "<version>" }
Caution
Using unreleased builds is not recommended unless directed by the development team, as functionality may not work correctly and no support will be provided.
Take a dependency on the crates you wish to use in your applications Cargo.toml, specifying the commit SHA of the nightly build you want:
[dependencies]
azure_iot_operations_mqtt = { git = "https://github.com/Azure/iot-operations-sdks.git", rev = "<commit SHA here>"}
azure_iot_operations_protocol = { git = "https://github.com/Azure/iot-operations-sdks.git", rev = "<commit SHA here>" }
azure_iot_operations_services = { git = "https://github.com/Azure/iot-operations-sdks.git", rev = "<commit SHA here>" }
azure_iot_operations_connector = { git = "https://github.com/Azure/iot-operations-sdks.git", rev = "<commit SHA here>" }Note
- Referencing different release tags can create dependency issues, it's recommended to use a common SHA across the packages.
Caution
The samples and tutorials provided in this repository are for demonstration purposed only, and should not be deployed to a production system or included within an application without a full understanding of how they operate.
Additionally some samples may use a username and password for authentication. This is used for sample simplicity and a production system should use a robust authentication mechanism such as certificates.
Each crate contains an examples directory containing samples demonstrating the usage of its API:
Run the sample, substituting the sample name of your choice:
cargo run --example <sample name>Tip
Do not include the .rs extension in the sample name.
There are also higher-level samples that show a set of related applications that can be built using the various components of the Rust SDK. They can be found in the sample_applications directory.