Azure App Configuration client for Rust
With azure-app-configuration you can easily work with your Azure App Configuration service centralized configurations.
Latest version supports:
- List keys
- List labels
- List key values
- Get key value
- Set key value (with label, tags and content type)
- Remove key value
Running samples
You can find some sample code snippets here: examples.
Just replace the configuration with your Azure configuration endpoint, your access_key and secret and execute them by using:
cargo run --example list-key-values
cargo run --example get_key_value
cargo run --example set_key_value
You can see all available targets in Cargo.toml file
Code samples
Create an AzureAppConfiguration client
To create an Azure App Configuration client just use ::new method and provide the endpoint url, the access key and the secret:
use AzureAppConfigClient;
let app_config_client = new;
List keys
//List all key values without a label (all key values);
let keys = app_config_client.list_keys.await.unwrap;
for k in keys.items
List labels
let labels = app_config_client.list_labels.await.unwrap;
for l in labels.items
List Key Values
let key_values = app_config_client.list_key_values.await;
for k in key_values
Get Key value with label
Retrieve value for key ConnectionString using label ContosoApp
let kv = app_config_client
.get_key_value
.await;
println!;
Get Key value without label
Retrieve a label called ConnectionString with no label specified
let kv = app_config_client
.get_key_value
.await;
println!;
Set key value
Delete ConnectionString key for Application1 label
let kv = app_config_client
.set_key
.await;
println!;
Set key value with tags and content type
let mut tags = new;
tags.insert;
tags.insert;
let kv = app_config_client
.set_key
.await;
println!;