From 3b2505f10aa06da632f33bcf8c989b730ae83f47 Mon Sep 17 00:00:00 2001 From: Nikhil Sinha <131262146+nikhilsinhaparseable@users.noreply.github.com> Date: Mon, 14 Oct 2024 21:02:39 +0530 Subject: [PATCH] enhancement: azure blob store support with client credentials (#961) add env P_AZR_CLIENT_ID, P_AZR_CLIENT_SECRET and P_AZR_TENANT_ID access key is made optional now --- server/src/storage/azure_blob.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/src/storage/azure_blob.rs b/server/src/storage/azure_blob.rs index ce26404fa..1c3a27883 100644 --- a/server/src/storage/azure_blob.rs +++ b/server/src/storage/azure_blob.rs @@ -72,9 +72,9 @@ pub struct AzureBlobConfig { long, env = "P_AZR_ACCESS_KEY", value_name = "access-key", - required = true + required = false )] - pub access_key: String, + pub access_key: Option, ///Client ID #[arg( @@ -123,9 +123,12 @@ impl AzureBlobConfig { let mut builder = MicrosoftAzureBuilder::new() .with_endpoint(self.endpoint_url.clone()) .with_account(&self.account) - .with_access_key(&self.access_key) .with_container_name(&self.container); + if let Some(access_key) = self.access_key.clone() { + builder = builder.with_access_key(access_key) + } + if let (Some(client_id), Some(client_secret), Some(tenant_id)) = ( self.client_id.clone(), self.client_secret.clone(),