Skip to content

Commit 3b2505f

Browse files
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
1 parent ffa6b32 commit 3b2505f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

server/src/storage/azure_blob.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ pub struct AzureBlobConfig {
7272
long,
7373
env = "P_AZR_ACCESS_KEY",
7474
value_name = "access-key",
75-
required = true
75+
required = false
7676
)]
77-
pub access_key: String,
77+
pub access_key: Option<String>,
7878

7979
///Client ID
8080
#[arg(
@@ -123,9 +123,12 @@ impl AzureBlobConfig {
123123
let mut builder = MicrosoftAzureBuilder::new()
124124
.with_endpoint(self.endpoint_url.clone())
125125
.with_account(&self.account)
126-
.with_access_key(&self.access_key)
127126
.with_container_name(&self.container);
128127

128+
if let Some(access_key) = self.access_key.clone() {
129+
builder = builder.with_access_key(access_key)
130+
}
131+
129132
if let (Some(client_id), Some(client_secret), Some(tenant_id)) = (
130133
self.client_id.clone(),
131134
self.client_secret.clone(),

0 commit comments

Comments
 (0)