Skip to content

Commit

Permalink
enhancement: azure blob store support with client credentials (#961)
Browse files Browse the repository at this point in the history
add env P_AZR_CLIENT_ID, P_AZR_CLIENT_SECRET and P_AZR_TENANT_ID
access key is made optional now
  • Loading branch information
nikhilsinhaparseable authored Oct 14, 2024
1 parent ffa6b32 commit 3b2505f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions server/src/storage/azure_blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,

///Client ID
#[arg(
Expand Down Expand Up @@ -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(),
Expand Down

0 comments on commit 3b2505f

Please sign in to comment.