Create a provider function for foundry_set_token_provider() that shells out
to az account get-access-token. Tokens are cached until five minutes before
expiry.
Arguments
- resource
Character. Azure resource used for the access token. Defaults to
"https://cognitiveservices.azure.com"for resource-level v1 and Content Safety APIs. Use"https://ai.azure.com"for project APIs and register that provider withscope = "project".- az
Character. Azure CLI executable name or path.
Examples
provider <- foundry_token_azure_cli()
is.function(provider)
#> [1] TRUE
if (FALSE) { # \dontrun{
# Requires Azure CLI installed and signed in to the intended Azure tenant.
token <- provider()
} # }