Retrieves an access token from Azure CLI using the az account get-access-token
command. This is a lower-level function that directly interacts with the Azure
CLI to obtain OAuth2 tokens.
Arguments
- scope
A character string specifying the OAuth2 scope for which to request the access token (e.g.,
"https://management.azure.com/.default").- tenant_id
A character string specifying the Azure Active Directory tenant ID. If
NULL, uses the default tenant from Azure CLI. Defaults toNULL.- timeout
A numeric value specifying the timeout in seconds for the Azure CLI process. Defaults to
10.
Value
An httr2::oauth_token() object containing:
access_token: The OAuth2 access token stringtoken_type: The type of token (typically "Bearer").expires_at: POSIXct timestamp when the token expires