During Public Preview you can use the Team plan for free, and get an early-adopter discount at GA. Sign in
locally run
This page is part of the CLI Reference and is generated from the CLI's own help output, so it matches what locally run --help prints.
For more information see Automatic Configuration.
locally run
Run a tool against Locally using Automatic Configuration (az, terraform, pulumi, curl, ...).
Runs a command against Locally instead of Azure.
The command must support Automatic Configuration: reading its credentials and endpoints from
environment variables, as az, Terraform, OpenTofu, Pulumi and the Azure SDKs do.
Locally flags (must appear BEFORE the command):
--subscription <name|uuid> run against a specific Subscription
--tenant <name|uuid> run against a specific Tenant
--user <upn|uuid> run as a directory user
--service-principal <uuid|name> run as a specific service principal
--managed-identity <uuid|name> run as a managed identity
--allow-no-subscriptions run in a Tenant that has no Subscriptions
--allow-remote-backend run Terraform/OpenTofu without confirming its remote backend
--resource <audience> the audience of the token added to a curl request, such as
api://<client-id> for your own app
Examples:
locally run az group list
locally run terraform apply
locally run tofu apply
locally run pulumi up
----
# Target another Subscription
locally run --subscription "Second Subscription" az group list
----
# Run as a directory user (delegated token; password never touches the environment)
locally run --user [email protected] az account show
# Run as a service principal (by appId or display name)
locally run --service-principal billing-runner terraform plan
# Run as a managed identity (by client id or display name; no secret touches the environment)
locally run --managed-identity deploy-mi terraform apply
# Call an API with curl; the token for the API being called is added automatically
locally run curl https://localhost:5679/v1.0/users
# Call your own app, which accepts tokens for its app registration
locally run --resource api://<client-id> curl https://<app>.<domain>/api/orders
Usage
locally run [flags]
Flags
-h, --help[=true|false] help for run
During Public Preview you can use the Team plan for free, and get an early-adopter discount at GA. Sign in