View source: R/credential-azure-cli.R
| az_cli_login | R Documentation |
Performs an interactive Azure CLI login using device code flow. Automatically captures the device code, copies it to the clipboard, and opens the browser for authentication.
az_cli_login(
tenant_id = NULL,
use_bridge = FALSE,
verbose = FALSE,
force = FALSE
)
tenant_id |
A character string specifying the Azure Active Directory
tenant ID to authenticate against. If |
use_bridge |
A logical value indicating whether to use the device code
bridge webpage. If |
verbose |
A logical value indicating whether to print detailed process
output to the console, including error messages from the Azure CLI process.
If |
force |
A logical value. If |
Unless force = TRUE, the function first runs az account show and, when
the Azure CLI is already logged in (to tenant_id, if given), returns that
account without starting a new login. Otherwise it runs
az login --use-device-code, monitors the output to extract the device
code, copies it to the clipboard, and opens the authentication URL in the
default browser.
Invisibly, the current account from az account show when an
existing login is reused; otherwise the accounts reported by az login
on success, or its non-zero exit status on failure.
# Reuses the current login if there is one
az_cli_login()
# Always start a new login
az_cli_login(force = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.