Skip to content

Commit

Permalink
add client id
Browse files Browse the repository at this point in the history
  • Loading branch information
wcy-fdu committed Mar 25, 2024
1 parent d5d4ea7 commit b40b99d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/azure/storage/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub struct Config {
/// Specifies the application id (client id) associated with a user assigned managed service identity resource
///
/// The values of object_id and msi_res_id are discarded
/// - nv value: [`AZURE_CLIENT_ID`]
///
/// This is part of use AAD(Azure Active Directory) authenticate on Azure VM
pub client_id: Option<String>,
Expand Down Expand Up @@ -70,6 +71,7 @@ pub struct Config {
pub const AZURE_FEDERATED_TOKEN: &str = "AZURE_FEDERATED_TOKEN";
pub const AZURE_FEDERATED_TOKEN_FILE: &str = "AZURE_FEDERATED_TOKEN_FILE";
pub const AZURE_TENANT_ID: &str = "AZURE_TENANT_ID";
pub const AZURE_CLIENT_ID: &str = "AZURE_CLIENT_ID";
pub const AZURE_AUTHORITY_HOST: &str = "AZURE_AUTHORITY_HOST";
const AZURE_PUBLIC_CLOUD: &str = "https://login.microsoftonline.com";

Expand All @@ -91,6 +93,10 @@ impl Config {
self.tenant_id = Some(v.to_string());
}

if let Some(v) = envs.get(AZURE_CLIENT_ID) {
self.client_id = Some(v.to_string());
}

if let Some(v) = envs.get(AZURE_AUTHORITY_HOST) {
self.authority_host = Some(v.to_string());
} else {
Expand Down

0 comments on commit b40b99d

Please sign in to comment.