From b40b99da415f09923aa2bc4825356f134b387359 Mon Sep 17 00:00:00 2001 From: congyi <15605187270@163.com> Date: Mon, 25 Mar 2024 17:07:29 +0800 Subject: [PATCH] add client id --- src/azure/storage/config.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/azure/storage/config.rs b/src/azure/storage/config.rs index b1b42bf..4cd42b9 100644 --- a/src/azure/storage/config.rs +++ b/src/azure/storage/config.rs @@ -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, @@ -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"; @@ -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 {