2 releases
0.1.1 | May 3, 2024 |
---|---|
0.1.0 | Apr 29, 2024 |
#2308 in Network programming
18KB
150 lines
Azure App Config
Purpose
This library is a quick wrapper around the azure keyvault REST API to support managed identity configuration setting grabbing.
Usage
Get All Key Values
let client = Client::new(azure_core::Url::parse(env::var("APPCONFIG_URI").expect("Missing APPCONFIG_URI Env Var").as_str()).unwrap(), azure_identity::create_credential().unwrap());
let resp = client.get_key_values(None, None, None).await;
Get a Specific Config Value
let client = Client::new(azure_core::Url::parse(env::var("APPCONFIG_URI").expect("Missing APPCONFIG_URI Env Var").as_str()).unwrap(), azure_identity::create_credential().unwrap());
let config_setting = client.get_key_value("ExampleConfigSetting", None, Some("Example:"), None).await.unwrap();
Get Feature Flags
let client = Client::new(azure_core::Url::parse(env::var("APPCONFIG_URI").expect("Missing APPCONFIG_URI Env Var").as_str()).unwrap(), azure_identity::create_credential().unwrap());
let feature_flags = client.get_feature_flags(None).await;
Get Feature Flag Is Enabled or Disabled
let client = Client::new(azure_core::Url::parse(env::var("APPCONFIG_URI").expect("Missing APPCONFIG_URI Env Var").as_str()).unwrap(), azure_identity::create_credential().unwrap());
let is_enabled = client.is_feature_enabled("ExampleFeatureFlag", None).await.unwrap();
Also see the Example: Basic Usage
Install
cargo add azure_app_config
Crates.IO
Dependencies
~10–21MB
~304K SLoC