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.
az_cli_get_token(scope, tenant_id = NULL, timeout = 10L)An httr2::oauth_token() object containing:
access_token: The OAuth2 access token string
token_type: The type of token (typically "Bearer")
.expires_at: POSIXct timestamp when the token expires
A character string specifying the OAuth2 scope for which to
request the access token (e.g., "https://management.azure.com/.default").
A character string specifying the Azure Active Directory
tenant ID. If NULL, uses the default tenant from Azure CLI. Defaults to NULL.
A numeric value specifying the timeout in seconds for the
Azure CLI process. Defaults to 10.
This function executes the Azure CLI command and parses the JSON response to create an httr2 OAuth token object. The token includes the access token, token type, and expiration time.