pub struct EnvironmentCredential { /* private fields */ }
Expand description
Enables authentication with Workflows Identity if either AZURE_FEDERATED_TOKEN
or AZURE_FEDERATED_TOKEN_FILE
is set,
otherwise enables authentication to Azure Active Directory using client secret, or a username and password.
Details configured in the following environment variables:
Variable | Description |
---|---|
AZURE_TENANT_ID | The Azure Active Directory tenant(directory) ID. |
AZURE_CLIENT_ID | The client(application) ID of an App Registration in the tenant. |
AZURE_CLIENT_SECRET | A client secret that was generated for the App Registration. |
AZURE_FEDERATED_TOKEN_FILE | Path to an federated token file. Variable is present in pods with aks workload identities. |
This credential ultimately uses a WorkloadIdentityCredential
or aClientSecretCredential
to perform the authentication using
these details.
Please consult the documentation of that class for more details.
Implementations§
Source§impl EnvironmentCredential
impl EnvironmentCredential
pub fn create( options: impl Into<TokenCredentialOptions>, ) -> Result<EnvironmentCredential>
Trait Implementations§
Source§impl Debug for EnvironmentCredential
impl Debug for EnvironmentCredential
Source§impl TokenCredential for EnvironmentCredential
impl TokenCredential for EnvironmentCredential
Source§fn get_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scopes: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<AccessToken>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scopes: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<AccessToken>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Gets a
AccessToken
for the specified resourceAuto Trait Implementations§
impl !Freeze for EnvironmentCredential
impl !RefUnwindSafe for EnvironmentCredential
impl Send for EnvironmentCredential
impl Sync for EnvironmentCredential
impl Unpin for EnvironmentCredential
impl !UnwindSafe for EnvironmentCredential
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more