Skip to content

Commit

Permalink
feat: add account_key/account_name for azure storage (#435)
Browse files Browse the repository at this point in the history
In order to make account_key account_name still works.
  • Loading branch information
wcy-fdu authored Apr 10, 2024
1 parent 31697b5 commit f005cc5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/azure/storage/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ 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 AZBLOB_ENDPOINT: &str = "AZBLOB_ENDPOINT";
const AZBLOB_ACCOUNT_KEY: &str = "AZBLOB_ACCOUNT_KEY";
const AZBLOB_ACCOUNT_NAME: &str = "AZBLOB_ACCOUNT_NAME";
const AZURE_PUBLIC_CLOUD: &str = "https://login.microsoftonline.com";

impl Config {
Expand All @@ -97,6 +100,18 @@ impl Config {
self.client_id = Some(v.to_string());
}

if let Some(v) = envs.get(AZBLOB_ENDPOINT) {
self.endpoint = Some(v.to_string());
}

if let Some(v) = envs.get(AZBLOB_ACCOUNT_KEY) {
self.account_key = Some(v.to_string());
}

if let Some(v) = envs.get(AZBLOB_ACCOUNT_NAME) {
self.account_name = 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 f005cc5

Please sign in to comment.