pub struct AzureCliCredential { /* private fields */ }Expand description
Authenticates by shelling out to the Azure CLI
(az account get-access-token --scope <scope> --output json).
Useful for local development where a developer is already signed in via
az login. Requires the az binary on PATH; a clear error is returned
when it is missing.
Implementations§
Trait Implementations§
Source§impl TokenCredential for AzureCliCredential
impl TokenCredential for AzureCliCredential
Source§fn get_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_token<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch a bearer token to send as
Authorization: Bearer <token>.Source§fn get_token_for_scope<'life0, 'life1, 'async_trait>(
&'life0 self,
scope: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_token_for_scope<'life0, 'life1, 'async_trait>(
&'life0 self,
scope: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch a bearer token for a specific
scope (audience), e.g.
"https://ai.azure.com/.default". Read moreAuto Trait Implementations§
impl !Freeze for AzureCliCredential
impl RefUnwindSafe for AzureCliCredential
impl Send for AzureCliCredential
impl Sync for AzureCliCredential
impl Unpin for AzureCliCredential
impl UnsafeUnpin for AzureCliCredential
impl UnwindSafe for AzureCliCredential
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