pub struct AzureBuilder { /* private fields */ }Expand description
Configure Azure authentication credentials.
§Example
let config = AzureBuilder::new()
.with_account(ACCOUNT)
.with_access_key(ACCESS_KEY)
.build(None);Implementations§
Source§impl AzureBuilder
impl AzureBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new AzureBuilder with default values.
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Create an instance of AzureBuilder with values pre-populated from environment variables.
Variables extracted from environment:
- AZURE_STORAGE_ACCOUNT_NAME: storage account name
- AZURE_STORAGE_ACCOUNT_KEY: storage account master key
- AZURE_STORAGE_ACCESS_KEY: alias for AZURE_STORAGE_ACCOUNT_KEY
- AZURE_STORAGE_CLIENT_ID -> client id for service principal authorization
- AZURE_STORAGE_CLIENT_SECRET -> client secret for service principal authorization
- AZURE_STORAGE_TENANT_ID -> tenant id used in oauth flows
Sourcepub fn with_config(self, key: AzureConfigKey, value: impl Into<String>) -> Self
pub fn with_config(self, key: AzureConfigKey, value: impl Into<String>) -> Self
Set an option on the builder via a key - value pair.
Sourcepub fn get_config_value(&self, key: &AzureConfigKey) -> Option<String>
pub fn get_config_value(&self, key: &AzureConfigKey) -> Option<String>
Get config value via a AzureConfigKey.
Sourcepub fn with_account(self, account: impl Into<String>) -> Self
pub fn with_account(self, account: impl Into<String>) -> Self
Set the Azure Account
Sourcepub fn with_access_key(self, access_key: impl Into<String>) -> Self
pub fn with_access_key(self, access_key: impl Into<String>) -> Self
Set the Azure Access Key
Set a static bearer token to be used for authorizing requests
Set a client secret used for client secret authorization
Sourcepub fn with_client_id(self, client_id: impl Into<String>) -> Self
pub fn with_client_id(self, client_id: impl Into<String>) -> Self
Sets the client id for use in client secret or k8s federated credential flow
Sourcepub fn with_client_secret(self, client_secret: impl Into<String>) -> Self
pub fn with_client_secret(self, client_secret: impl Into<String>) -> Self
Sets the client secret for use in client secret flow
Sourcepub fn with_tenant_id(self, tenant_id: impl Into<String>) -> Self
pub fn with_tenant_id(self, tenant_id: impl Into<String>) -> Self
Sets the tenant id for use in client secret or k8s federated credential flow
Sourcepub fn with_scope(self, scope: impl Into<String>) -> Self
pub fn with_scope(self, scope: impl Into<String>) -> Self
Set the OAuth scope for client credentials flow
Sourcepub fn with_credentials(self, credentials: AzureCredentialProvider) -> Self
pub fn with_credentials(self, credentials: AzureCredentialProvider) -> Self
Set the credential provider overriding any other options
Sourcepub fn with_endpoint(self, endpoint: String) -> Self
pub fn with_endpoint(self, endpoint: String) -> Self
Override the endpoint used to communicate with Azure
Sourcepub fn with_allow_http(self, allow_http: bool) -> Self
pub fn with_allow_http(self, allow_http: bool) -> Self
Sets what protocol is allowed
Sets an alternative authority host for OAuth based authorization
Defaults to https://login.microsoftonline.com
Sourcepub fn with_retry(self, retry_config: RetryConfig) -> Self
pub fn with_retry(self, retry_config: RetryConfig) -> Self
Set the retry configuration
Sourcepub fn with_proxy_url(self, proxy_url: impl Into<String>) -> Self
pub fn with_proxy_url(self, proxy_url: impl Into<String>) -> Self
Set the proxy_url to be used by the underlying client
Sourcepub fn with_proxy_ca_certificate(
self,
proxy_ca_certificate: impl Into<String>,
) -> Self
pub fn with_proxy_ca_certificate( self, proxy_ca_certificate: impl Into<String>, ) -> Self
Set a trusted proxy CA certificate
Sourcepub fn with_proxy_excludes(self, proxy_excludes: impl Into<String>) -> Self
pub fn with_proxy_excludes(self, proxy_excludes: impl Into<String>) -> Self
Set a list of hosts to exclude from proxy connections
Sourcepub fn with_client_options(self, options: ClientOptions) -> Self
pub fn with_client_options(self, options: ClientOptions) -> Self
Sets the client options, overriding any already set
Sourcepub fn with_msi_endpoint(self, msi_endpoint: impl Into<String>) -> Self
pub fn with_msi_endpoint(self, msi_endpoint: impl Into<String>) -> Self
Sets the endpoint for acquiring managed identity token
Sourcepub fn with_federated_token_file(
self,
federated_token_file: impl Into<String>,
) -> Self
pub fn with_federated_token_file( self, federated_token_file: impl Into<String>, ) -> Self
Sets a file path for acquiring azure federated identity token in k8s
Sourcepub fn with_use_azure_cli(self, use_azure_cli: bool) -> Self
pub fn with_use_azure_cli(self, use_azure_cli: bool) -> Self
Set if the Azure Cli should be used for acquiring access token
Sourcepub fn with_skip_signature(self, skip_signature: bool) -> Self
pub fn with_skip_signature(self, skip_signature: bool) -> Self
If enabled, requests will not be signed
Sourcepub fn build(self, runtime: Option<&Handle>) -> Result<AzureConfig>
pub fn build(self, runtime: Option<&Handle>) -> Result<AzureConfig>
Build an AzureConfig from the provided values, consuming self.
Build an AzureConfig from the provided values, consuming self.
If runtime is provided, all HTTP I/O (including credential refresh)
will be spawned on the given runtime handle.
Trait Implementations§
Source§impl Clone for AzureBuilder
impl Clone for AzureBuilder
Source§fn clone(&self) -> AzureBuilder
fn clone(&self) -> AzureBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more