zuke.tools.az
@zuke/az 1.2.1: @zuke/az — typed Azure CLI tasks, readers, and a canary platform and analysis.
zuke on PyPI ↗ 46 symbols
Symbols
class AzAccountGetAccessTokenSettings(AzSettings) Settings for az account get-access-token.
The answer is a bearer token, so the command always runs quietly — captured, never streamed — with --output json pinned whatever the settings or the user's config say, and the token is registered with the run's redactor once it returns.
-
resource(uri: str) -> SelfThe resource the token is for, as a Microsoft Entra v1.0 endpoint (
--resource). -
resource_type(type_: Literal['oss-rdbms', 'arm', 'aad-graph', 'ms-graph', 'batch', 'media', 'data-lake']) -> SelfA well-known resource the token is for (
--resource-type). -
scope(*scopes: str) -> SelfMicrosoft Entra v2.0 scopes for the token (
--scope); repeatable. -
tenant(tenant: str) -> SelfThe tenant to get the token from (
--tenant).
class AzAccountListSettings(AzSettings) Settings for az account list.
-
all() -> SelfInclude subscriptions from every cloud and in every state (
--all). -
refresh() -> SelfRead the subscriptions from the server, not the cache (
--refresh).
class AzAccountSetSettings(AzSettings) Settings for az account set: make a subscription the default. Name it with the global .subscription(nameOrId), which account set requires.
class AzAccountShowSettings(AzSettings) Settings for az account show: the current (or the given) subscription.
class AzAcrBuildSettings(AzSettings) Settings for az acr build: build an image in the registry from a local directory, a git URL or a tarball, and push it.
--build-arg values are visible to the ACR team for debugging, as the CLI warns; pass a credential with secretBuildArg, whose value is also registered with the run's redactor.
-
registry(name: str) -> SelfThe registry to build in (
--registry). -
source(location: str) -> SelfThe build context: a directory, a git URL or a tarball URL (the positional source).
-
image(name_and_tag: str) -> SelfA
name:tagto give the image (--image); repeatable. -
file(path: str) -> SelfThe Dockerfile, relative to the source (
--file). -
build_arg(name: str, value: str) -> SelfA build argument (
--build-arg name=value); repeatable. Never a credential. -
secret_build_arg(name: str, value: str) -> SelfA build argument the ACR team does not see (
--secret-build-arg name=value); repeatable. The value is registered with the run's redactor; it is still part of the argv. -
platform(platform: str) -> SelfThe platform to build for (
--platform), e.g."linux/arm64". -
target(stage: str) -> SelfThe Dockerfile stage to build (
--target). -
timeout(seconds: float) -> SelfThe build's timeout in seconds (
--timeout). -
resource_group(name: str) -> SelfThe registry's resource group (
--resource-group). -
no_push() -> SelfBuild without pushing (
--no-push). -
no_logs() -> SelfDo not stream the build's logs (
--no-logs). -
no_wait() -> SelfReturn once the build is queued (
--no-wait).
class AzAcrLoginSettings(AzSettings) Settings for az acr login.
Without exposeToken the CLI logs the local Docker client in itself. With it, the CLI prints a registry refresh token instead — for docker login with the user 00000000-0000-0000-0000-000000000000 — so the command always runs quietly with --output json pinned, and the token is registered with the run's redactor once it returns.
-
name(name: str) -> SelfThe registry's name (
--name). -
expose_token() -> SelfPrint a token instead of logging Docker in (
--expose-token). -
username(name: str) -> SelfA registry user, instead of the signed-in identity (
--username). -
password(secret: str) -> SelfThe registry user's password (
--password), sent on standard input as--password=@-so it never enters the argv, and registered with the run's redactor. -
suffix(suffix: str) -> SelfThe tenant suffix of the registry's login server (
--suffix).
class AzAcrRepositoryDeleteSettings(AzSettings) Settings for az acr repository delete: one image, by tag or digest, or a whole repository. The CLI asks for confirmation unless yes is set.
-
name(name: str) -> SelfThe registry's name (
--name). -
image(image: str) -> SelfThe image to delete,
repo:tagorrepo@digest(--image). -
repository(name: str) -> SelfDelete the whole repository, every tag in it (
--repository). -
yes() -> SelfDelete without asking (
--yes).
class AzAcrRepositoryShowTagsSettings(AzSettings) Settings for az acr repository show-tags.
-
name(name: str) -> SelfThe registry's name (
--name). -
repository(name: str) -> SelfThe repository whose tags to list (
--repository). -
top(count: float) -> SelfAt most this many tags (
--top). -
orderby(order: Literal['time_asc', 'time_desc']) -> SelfOrder by time, oldest or newest first (
--orderby); by name otherwise. -
detail() -> SelfEach tag's details, not only its name (
--detail).
class AzAksGetCredentialsSettings(AzResourceSettings) Settings for az aks get-credentials. The credentials go to a file — ~/.kube/config unless file says otherwise. Printing them (--file -) would put a cluster credential in the build log, so a - is refused.
-
admin() -> SelfGet the cluster-admin credentials (
--admin). -
file(path: str) -> SelfThe kubeconfig file to write (
--file);~/.kube/configby default. -
overwrite_existing() -> SelfReplace an existing entry of the same name (
--overwrite-existing). -
context(name: str) -> SelfThe context name to write, instead of the cluster's (
--context). -
public_fqdn() -> SelfPoint the kubeconfig at the cluster's public FQDN (
--public-fqdn). -
format(format: Literal['azure', 'exec']) -> SelfThe credential format (
--format):azureorexec(kubelogin).
class AzAksShowSettings(AzResourceSettings) Settings for az aks show.
class AzContainerappIngressTrafficSetSettings(AzResourceSettings) Settings for az containerapp ingress traffic set: the share of traffic each revision — or each label — receives. The weights must add up to 100; the CLI checks.
-
revision_weight(revision: str, weight: float) -> SelfA revision's share of traffic, in percent (
--revision-weight revision=weight); repeatable."latest"is the newest revision. -
label_weight(label: str, weight: float) -> SelfA label's share of traffic, in percent (
--label-weight label=weight); repeatable.
class AzContainerappRevisionListSettings(AzResourceSettings) Settings for az containerapp revision list.
-
all() -> SelfInclude inactive revisions (
--all).
class AzContainerappRevisionSettings(AzResourceSettings) Settings for az containerapp revision activate and deactivate: the app, and the revision to switch.
-
revision(name: str) -> SelfThe revision to activate or deactivate (
--revision).
class AzContainerappShowSettings(AzResourceSettings) Settings for az containerapp show. Secrets stay out: --show-secrets is not typed.
class AzContainerappUpdateSettings(AzResourceSettings) Settings for az containerapp update: a new image, environment or scale, which makes a new revision.
-
image(image: str) -> SelfThe container image (
--image), e.g."myregistry.azurecr.io/api:1.4.0". -
container_name(name: str) -> SelfThe container to update, when the app has several (
--container-name). -
revision_suffix(suffix: str) -> SelfA suffix for the new revision's name (
--revision-suffix). -
set_env_var(name: str, value: str) -> SelfAdd or update an environment variable (
--set-env-vars name=value); repeatable. A value ofsecretref:<secret>reads one of the app's secrets. -
remove_env_vars(*names: str) -> SelfRemove environment variables (
--remove-env-vars); repeatable. -
cpu(cores: float) -> SelfCPU cores for the container (
--cpu), e.g.0.5. -
memory(amount: str) -> SelfMemory for the container (
--memory), e.g."1.0Gi". -
min_replicas(count: float) -> SelfThe fewest replicas (
--min-replicas). -
max_replicas(count: float) -> SelfThe most replicas (
--max-replicas). -
yaml(path: str) -> SelfTake the whole configuration from a YAML file (
--yaml); other options are ignored.
class AzDeploymentGroupCreateSettings(AzDeploymentGroupTemplateSettings) Settings for az deployment group create.
-
no_wait() -> SelfReturn once the deployment has started (
--no-wait).
class AzDeploymentGroupShowSettings(AzResourceSettings) Settings for az deployment group show.
class AzDeploymentGroupTemplateSettings(AzResourceSettings) The template, parameters and mode a deploying deployment group command shares — create and what-if read them identically. The deployment's --name is optional here; the CLI defaults it to the template file's name.
-
template_file(path: str) -> SelfA local ARM template or Bicep file (
--template-file). -
template_uri(uri: str) -> SelfA template at a URL (
--template-uri). -
template_spec(id: str) -> SelfA template spec, by resource id (
--template-spec). -
parameters_file(path: str) -> SelfA parameters file — JSON or
.bicepparam(--parameters <path>); repeatable, later values winning. -
parameter(name: str, value: str | float | bool) -> SelfOne parameter (
--parameters name=value); repeatable. The value is converted to the type the template declares. It is part of the argv, so a secure value belongs in a parameters file or a Key Vault reference. -
mode(mode: Literal['Incremental', 'Complete']) -> SelfIncremental(the default) orComplete, which deletes what the template omits (--mode).
class AzDeploymentGroupWhatIfSettings(AzDeploymentGroupTemplateSettings) Settings for az deployment group what-if: what a deployment would change.
-
result_format(format: Literal['FullResourcePayloads', 'ResourceIdOnly']) -> SelfHow much of each change to show (
--result-format). -
exclude_change_types(*types: Literal['Create', 'Delete', 'Deploy', 'Ignore', 'Modify', 'NoChange', 'Unsupported']) -> SelfLeave these kinds of change out (
--exclude-change-types); repeatable. -
no_pretty_print() -> SelfPrint the result as JSON rather than the formatted diff (
--no-pretty-print).
class AzFunctionappDeploymentSourceConfigZipSettings(AzResourceSettings) Settings for az functionapp deployment source config-zip: deploy a zip package to a function app. This is the generally available command; az functionapp deploy is still in preview.
-
src(path: str) -> SelfThe zip package (
--src). -
build_remote(value: bool) -> SelfBuild the package on the service — install dependencies there (
--build-remote). -
timeout(seconds: float) -> SelfHow long to wait for the deployment's status, in seconds (
--timeout). -
slot(name: str) -> SelfA slot instead of production (
--slot).
class AzGroupCreateSettings(AzSettings) Settings for az group create.
-
name(name: str) -> SelfThe resource group's name (
--name). -
location(location: str) -> SelfThe region to create it in (
--location), e.g."westeurope". -
tag(key: str, value: str) -> SelfA tag (
--tags key=value); repeatable. -
managed_by(id: str) -> SelfThe id of the resource that manages the group (
--managed-by).
class AzGroupDeleteSettings(AzSettings) Settings for az group delete. The CLI asks for confirmation unless yes is set — and fails, without a terminal to ask on.
-
name(name: str) -> SelfThe resource group's name (
--name). -
yes() -> SelfDelete without asking (
--yes). -
no_wait() -> SelfReturn once the deletion has started (
--no-wait). -
force_deletion_types(type_: Literal['Microsoft.Compute/virtualMachines', 'Microsoft.Compute/virtualMachineScaleSets', 'Microsoft.Databricks/workspaces']) -> SelfForce-delete the group's resources of this type (
--force-deletion-types).
class AzGroupExistsSettings(AzSettings) Settings for az group exists, which prints true or false.
-
name(name: str) -> SelfThe resource group's name (
--name).
class AzGroupShowSettings(AzSettings) Settings for az group show.
-
name(name: str) -> SelfThe resource group's name (
--name).
class AzKeyvaultSecretSetSettings(AzSettings) Settings for az keyvault secret set.
The value comes from a file — read exactly, with its encoding — or from value, which is sent on standard input as --value=@- so it never enters the argv. The CLI strips trailing line breaks from what it reads that way; use a file for a value that must keep them.
-
vault_name(name: str) -> SelfThe vault's name (
--vault-name). -
name(name: str) -> SelfThe secret's name (
--name). -
value(secret: str) -> SelfThe value, sent on standard input as
--value=@-and registered with the run's redactor. -
file(path: str) -> SelfRead the value from a file (
--file) — the way to keep it exact. -
encoding(encoding: Literal['utf-8', 'utf-16le', 'utf-16be', 'ascii', 'base64', 'hex']) -> SelfHow the file is encoded (
--encoding);utf-8by default. Refused without a file: the CLI saves it as afile-encodingtag thatkeyvault secret downloadlater decodes with. -
content_type(type_: str) -> SelfWhat the value is, e.g.
"password"(--content-type). -
expires(time: str) -> SelfWhen the secret expires (
--expires): aDate, or a string such as2027-01-01T00:00:00Z— the CLI takes UTC to the second, no fractions. -
not_before(time: str) -> SelfWhen the secret becomes usable (
--not-before), in the same form as expires. -
disabled(value: bool) -> SelfCreate the secret disabled, or enabled (
--disabled). -
tag(key: str, value: str) -> SelfA tag (
--tags key=value); repeatable.
class AzKeyvaultSecretShowSettings(AzSettings) Settings for az keyvault secret show.
-
vault_name(name: str) -> SelfThe vault's name (
--vault-name). -
name(name: str) -> SelfThe secret's name (
--name). -
version(version: str) -> SelfA specific version; the latest when omitted (
--version). -
id(identifier: str) -> SelfThe secret's full identifier, instead of vault and name (
--id).
class AzLoginSettings(AzSettings) Settings for az login, for the non-interactive forms a build uses. The interactive browser and device-code forms are left to .command("login").
Exactly one credential is sent: a secret (password), a certificate or a federatedToken for a service principal, or identity for a managed identity. A service principal without one would make the CLI prompt for a password, so it is refused here.
az login reads the global .subscription(...) as the subscription to make the default once it has signed in. Its output lists the account's subscriptions — no credential — so it is not masked.
-
service_principal() -> SelfLog in as a service principal (
--service-principal). -
username(client_id: str) -> SelfThe service principal's client id (
--username). -
tenant(tenant: str) -> SelfThe Microsoft Entra tenant, required for a service principal (
--tenant). -
password(secret: str) -> SelfThe service principal's client secret (
--password), sent on standard input as--password=@-so it never enters the argv, and registered with the run's redactor. Prefer federatedToken (no long-lived secret) or certificate. -
federated_token(token: str) -> SelfA federated token (OIDC) to exchange for the service principal's access (
--federated-token), sent on standard input as--federated-token=@-and registered with the run's redactor. -
certificate(path: str) -> SelfA PEM file with the service principal's key and certificate (
--certificate). -
use_cert_sn_issuer() -> SelfAuthenticate with Subject Name + Issuer, for automatic certificate rolls (
--use-cert-sn-issuer). -
identity() -> SelfLog in with the managed identity of the machine the build runs on (
--identity). -
client_id(id: str) -> SelfA user-assigned managed identity, by client id (
--client-id). -
object_id(id: str) -> SelfA user-assigned managed identity, by object id (
--object-id). -
resource_id(id: str) -> SelfA user-assigned managed identity, by resource id (
--resource-id). -
allow_no_subscriptions() -> SelfSucceed for a tenant with no subscriptions (
--allow-no-subscriptions).
class AzLogoutSettings(AzSettings) Settings for az logout.
-
username(name: str) -> SelfThe account to log out; the active one when omitted (
--username).
class AzMonitorActivityLogListSettings(AzSettings) Settings for az monitor activity-log list: the control-plane events of a subscription, resource group or resource. The CLI returns at most maxEvents — 50 unless told otherwise.
-
start_time(time: str) -> SelfThe start of the range (
--start-time). -
end_time(time: str) -> SelfThe end of the range (
--end-time); now by default. -
offset(duration: str | float) -> SelfThe length of the range when only one end is given (
--offset); six hours by default. -
resource_group(name: str) -> SelfOnly events in this resource group (
--resource-group). -
resource_id(id: str) -> SelfOnly events on this resource (
--resource-id). -
namespace(namespace: str) -> SelfOnly events from this resource provider (
--namespace). -
caller(caller: str) -> SelfOnly events by this caller (
--caller). -
status(status: str) -> SelfOnly events with this status, e.g.
"Failed"(--status). -
correlation_id(id: str) -> SelfOnly the events of this operation (
--correlation-id). -
max_events(count: float) -> SelfThe most events to return (
--max-events); 50 by default. -
select(*properties: str) -> SelfOnly these properties of each event (
--select); repeatable.
class AzMonitorLogAnalyticsQuerySettings(AzSettings) Settings for az monitor log-analytics query.
-
workspace(id: str) -> SelfThe workspace's id — its customer id, a GUID (
--workspace). -
analytics_query(query: str) -> SelfThe KQL query (
--analytics-query). -
timespan(range: str | float) -> SelfThe range to query (
--timespan): a duration back from now, as"30m"or milliseconds (sent as ISO 8601), or an ISO 8601 interval string such as"2026-10-07T10:00:00Z/2026-10-07T11:00:00Z", sent as written. All the data by default. -
workspaces(*ids: str) -> SelfFurther workspaces to union into the query (
--workspaces); repeatable.
class AzMonitorMetricsAlertListSettings(AzSettings) Settings for az monitor metrics alert list.
-
resource_group(name: str) -> SelfOnly the rules in this resource group (
--resource-group).
class AzMonitorMetricsAlertShowSettings(AzResourceSettings) Settings for az monitor metrics alert show: one metric alert rule. The rule's definition, not whether it is firing — that lives in Azure Monitor's alerts, not in the rule.
class AzMonitorMetricsListDefinitionsSettings(AzSettings) Settings for az monitor metrics list-definitions: the metrics a resource has.
-
resource(id: str) -> SelfThe resource, by full resource id (
--resource). -
namespace(namespace: str) -> SelfOnly this metric namespace (
--namespace).
class AzMonitorMetricsListSettings(AzSettings) Settings for az monitor metrics list: a resource's metrics over a time range, one datapoint per interval.
The CLI returns at most top time series per metric — ten unless told otherwise — so a query that splits by a dimension can silently lose series; raise top to cover them.
-
resource(id: str) -> SelfThe resource, by full resource id (
--resource). -
metrics(*names: str) -> SelfThe metrics to read, by name (
--metrics); repeatable. -
aggregation(*types: Literal['Average', 'Count', 'Maximum', 'Minimum', 'Total']) -> SelfThe aggregations to compute per interval (
--aggregation); repeatable. -
interval(interval: Literal['PT1M', 'PT5M', 'PT15M', 'PT30M', 'PT1H', 'PT6H', 'PT12H', 'PT24H']) -> SelfThe time grain of each datapoint (
--interval); one minute by default. The range set by window is not aligned to it, so the newest datapoint may cover an interval that is still being written. -
start_time(time: str) -> SelfThe start of the range (
--start-time). -
end_time(time: str) -> SelfThe end of the range (
--end-time); now by default. -
window(duration: str | float, end: str | None=None) -> SelfThe
duration("15m", or milliseconds) up toend— now, unless given — as--start-timeand--end-time. -
offset(duration: str | float) -> SelfThe length of the range when only one end is given (
--offset, as"30m"or milliseconds); an hour by default. -
filter(expression: str) -> SelfAn OData filter on the dimensions (
--filter), e.g."ApiName eq 'GetBlob' and GeoType eq '*'". For plain equality, prefer dimension, which quotes the value. -
dimension(name: str, value: str) -> SelfOnly the series where the dimension
nameisvalue— rendered into--filterasname eq 'value', joined withand; repeatable. -
split_by(*dimensions: str) -> SelfSplit the series by these dimensions (
--dimension); repeatable. -
namespace(namespace: str) -> SelfThe metric namespace (
--namespace). -
top(count: float) -> SelfThe most time series to return per metric (
--top); 10 by default. -
orderby(order: str) -> SelfThe aggregation and direction to sort series by (
--orderby), e.g."sum desc".
class AzMonitorMetricValueSettings(AzMonitorMetricsListSettings) Settings for AzTasks.metricValue: a metrics list request with exactly one AzMonitorMetricsListSettings.aggregation, and how to read it.
-
metric(name: str) -> SelfThe metric to read, by name. Needed only when the request names more than one with
.metrics(...). -
aggregate(how: Literal['latest', 'sum', 'average', 'maximum', 'minimum']) -> SelfHow to turn the datapoints into one number, across every series the answer holds.
"latest"(the default) is the newest interval — the sum of the series' values at the newest timestamp any of them has, so a metric split by a dimension reads as its total. The others combine every datapoint in the range: a"sum"of per-minuteTotals is the range's total. -
missing_data_as(value: float) -> SelfReturn
valuewhen there are no datapoints, instead of failing. Azure Monitor reports an interval with no events without a value, so for a count of errors no data does mean0; for a latency it usually means the query is looking in the wrong place.
class AzResourceSettings(AzSettings) Settings for a command on one named resource in a resource group.
-
name(name: str) -> SelfThe resource's name (
--name). -
resource_group(name: str) -> SelfThe resource group the resource is in (
--resource-group).
class AzSettings(SubcommandSettings) Settings for an az invocation.
Every instance sets three of the CLI's configuration variables in the child's environment, so the CLI never waits on a keypress, installs code, or colours a build log:
- AZURE_EXTENSION_USE_DYNAMIC_INSTALL=no — a command from an extension that is not installed fails, instead of prompting (on a terminal) or silently downloading and installing the extension (without one). The CLI's message does not name the extension — it says the command is misspelled or not recognized by the system and exits 2 — so install what a build needs up front with az extension add --name <name>. - AZURE_CORE_LOGIN_EXPERIENCE_V2=off — an interactive az login does not open its subscription selector. - AZURE_CORE_NO_COLOR=true — no ANSI colour codes in captured output.
Setting them there keeps the argv exactly what the settings say; override any of them with .env({...}). A confirmation prompt (group delete without --yes) is not switched off: on a terminal it asks, without one the CLI fails — call the command's .yes() to confirm in the build.
-
subscription(name_or_id: str) -> SelfThe subscription to run against, by name or id (
--subscription); the CLI's default subscription when omitted. Most commands take it; theaccountcommands read it as the subscription they act on. -
output(format: Literal['json', 'jsonc', 'yaml', 'yamlc', 'table', 'tsv', 'none']) -> SelfThe output format (
--output):json,jsonc,yaml,yamlc,table,tsvornone. -
query(expression: str) -> SelfA JMESPath expression that filters the output (
--query). -
only_show_errors() -> SelfPrint errors only, suppressing warnings (
--only-show-errors). The CLI refuses it beside--debugor--verbose, and so do these settings. -
verbose() -> SelfMore logging, on stderr (
--verbose). -
env(record: Mapping[str, str]) -> SelfMerge additional environment variables for the process. Under debug — set before or after — a credential variable set here is registered with the run's redactor, like one in the build's environment.
-
debug() -> SelfTurn on the CLI's debug logging (
--debug), written to stderr. The debug log can carry credentials: request and response details, which for a Key Vault or storage command include what was read or sent. The credentials the CLI reads from the environment —AZURE_STORAGE_KEY,AZURE_STORAGE_CONNECTION_STRING,AZURE_STORAGE_SAS_TOKEN,AZURE_CLIENT_SECRET,AZURE_DEVOPS_EXT_PAT, and Terraform'sARM_CLIENT_SECRETbeside them — are registered with the run's redactor, whether they are in the build's environment or set with env, but a token the CLI holds in its own cache (~/.azure) is not known here and is not masked. Keep it for a local investigation, never a shared CI log. -
flag(name: str, value: str | float | None=None) -> SelfAdd an arbitrary option:
--name value, or the bare--name. Two hazards come with the escape hatch, which the typed setters guard and this does not: a value that starts with-is read by the CLI as the next option, and a value that starts with@— or, in akey=valuelist element, a value after the=that does — is replaced by that file's contents (@-by standard input), which then leave the machine in the request. Never pass an untrusted value here, or through.args(...)or.command(...).
class AzStorageBlobDownloadSettings(AzStorageBlobSettings) Settings for az storage blob download.
-
container_name(name: str) -> SelfThe container (
--container-name). -
name(name: str) -> SelfThe blob's name (
--name). -
file(path: str) -> SelfThe local file to write (
--file). -
overwrite(value: bool) -> SelfReplace an existing local file (
--overwrite).
class AzStorageBlobSettings(AzSettings) The account and credential options every storage blob command takes. One credential at most: the CLI reads it from standard input.
-
account_name(name: str) -> SelfThe storage account (
--account-name). -
auth_mode(mode: Literal['login', 'key']) -> Selfloginuses the signed-in identity;keyan account key (--auth-mode). -
account_key(key: str) -> SelfThe account key (
--account-key), sent on standard input. -
sas_token(token: str) -> SelfA SAS token (
--sas-token), sent on standard input. Its signature is registered on its own as well — as written, decoded and URL-encoded — since the CLI's debug log prints the token URL-encoded inside a request URL, where the token as a whole never appears. -
connection_string(connection: str) -> SelfA connection string (
--connection-string), sent on standard input.
class AzStorageBlobUploadBatchSettings(AzStorageBlobSettings) Settings for az storage blob upload-batch: upload a directory.
-
source(path: str) -> SelfThe local directory to upload (
--source). -
destination(container: str) -> SelfThe container, by name or URL (
--destination). -
pattern(glob: str) -> SelfUpload only the files matching this glob (
--pattern). -
destination_path(path: str) -> SelfA path inside the container to upload under (
--destination-path). -
overwrite(value: bool) -> SelfReplace existing blobs (
--overwrite). -
dryrun() -> SelfShow what would be uploaded without uploading (
--dryrun).
class AzStorageBlobUploadSettings(AzStorageBlobSettings) Settings for az storage blob upload.
-
container_name(name: str) -> SelfThe container (
--container-name). -
name(name: str) -> SelfThe blob's name (
--name). -
file(path: str) -> SelfThe local file to upload (
--file). -
overwrite(value: bool) -> SelfReplace an existing blob (
--overwrite). -
content_type(type_: str) -> SelfThe blob's MIME type (
--content-type). -
content_cache_control(value: str) -> SelfThe blob's
Cache-Control(--content-cache-control). -
tag(key: str, value: str) -> SelfA blob index tag (
--tags key=value); repeatable.
class AzTasks Typed task functions for the az CLI.
-
static async run(ctx: ServiceContext, configure: Callable[[AzSettings], AzSettings] | None=None) -> ExecResultRun any
azcommand, built with.command(group, …, verb). -
static async login(ctx: ServiceContext, configure: Callable[[AzLoginSettings], AzLoginSettings] | None=None) -> ExecResultSign the CLI in, non-interactively:
az login. -
static async logout(ctx: ServiceContext, configure: Callable[[AzLogoutSettings], AzLogoutSettings] | None=None) -> ExecResultSign the CLI out:
az logout. -
static async account_show(ctx: ServiceContext, configure: Callable[[AzAccountShowSettings], AzAccountShowSettings] | None=None) -> ExecResultDescribe the current subscription:
az account show. -
static async account_set(ctx: ServiceContext, configure: Callable[[AzAccountSetSettings], AzAccountSetSettings] | None=None) -> ExecResultMake a subscription the default:
az account set. -
static async account_list(ctx: ServiceContext, configure: Callable[[AzAccountListSettings], AzAccountListSettings] | None=None) -> ExecResultList the subscriptions:
az account list. -
static async account_get_access_token(ctx: ServiceContext, configure: Callable[[AzAccountGetAccessTokenSettings], AzAccountGetAccessTokenSettings] | None=None) -> ExecResultGet an access token:
az account get-access-token(captured, never streamed). -
static async access_token(ctx: ServiceContext, configure: Callable[[AzAccountGetAccessTokenSettings], AzAccountGetAccessTokenSettings] | None=None) -> objectAn access token, read back as a string and registered as a secret. Pins
--query accessToken --output json. -
static async subscription_id(ctx: ServiceContext, configure: Callable[[AzAccountShowSettings], AzAccountShowSettings] | None=None) -> objectThe subscription id the CLI acts on. Pins
--query id --output tsv. -
static async tenant_id(ctx: ServiceContext, configure: Callable[[AzAccountShowSettings], AzAccountShowSettings] | None=None) -> objectThe tenant id of the current subscription. Pins
--query tenantId --output tsv. -
static async group_create(ctx: ServiceContext, configure: Callable[[AzGroupCreateSettings], AzGroupCreateSettings] | None=None) -> ExecResultCreate a resource group:
az group create. -
static async group_show(ctx: ServiceContext, configure: Callable[[AzGroupShowSettings], AzGroupShowSettings] | None=None) -> ExecResultDescribe a resource group:
az group show. -
static async group_delete(ctx: ServiceContext, configure: Callable[[AzGroupDeleteSettings], AzGroupDeleteSettings] | None=None) -> ExecResultDelete a resource group:
az group delete. -
static async group_exists(ctx: ServiceContext, configure: Callable[[AzGroupExistsSettings], AzGroupExistsSettings] | None=None) -> ExecResultPrint whether a resource group exists:
az group exists. -
static async resource_group_exists(ctx: ServiceContext, name: str, configure: Callable[[AzGroupExistsSettings], AzGroupExistsSettings] | None=None) -> objectWhether resource group
nameexists. Pins--output json. -
static async acr_login(ctx: ServiceContext, configure: Callable[[AzAcrLoginSettings], AzAcrLoginSettings] | None=None) -> ExecResultLog in to a registry:
az acr login(captured, never streamed). -
static async acr_token(ctx: ServiceContext, configure: Callable[[AzAcrLoginSettings], AzAcrLoginSettings] | None=None) -> objectA registry refresh token, for
docker loginas00000000-0000-0000-0000-000000000000:az acr login --expose-token, read back and registered as a secret. Pins--query accessToken --output json. -
static async acr_build(ctx: ServiceContext, configure: Callable[[AzAcrBuildSettings], AzAcrBuildSettings] | None=None) -> ExecResultBuild and push an image in the registry:
az acr build. -
static async acr_repository_show_tags(ctx: ServiceContext, configure: Callable[[AzAcrRepositoryShowTagsSettings], AzAcrRepositoryShowTagsSettings] | None=None) -> ExecResultList a repository's tags:
az acr repository show-tags. -
static async acr_repository_delete(ctx: ServiceContext, configure: Callable[[AzAcrRepositoryDeleteSettings], AzAcrRepositoryDeleteSettings] | None=None) -> ExecResultDelete an image or a repository:
az acr repository delete. -
static async aks_get_credentials(ctx: ServiceContext, configure: Callable[[AzAksGetCredentialsSettings], AzAksGetCredentialsSettings] | None=None) -> ExecResultWrite a cluster's credentials to a kubeconfig:
az aks get-credentials. -
static async aks_show(ctx: ServiceContext, configure: Callable[[AzAksShowSettings], AzAksShowSettings] | None=None) -> ExecResultDescribe a cluster:
az aks show. -
static async containerapp_update(ctx: ServiceContext, configure: Callable[[AzContainerappUpdateSettings], AzContainerappUpdateSettings] | None=None) -> ExecResultRoll a container app onto a new revision:
az containerapp update. -
static async containerapp_show(ctx: ServiceContext, configure: Callable[[AzContainerappShowSettings], AzContainerappShowSettings] | None=None) -> ExecResultDescribe a container app:
az containerapp show. -
static async containerapp_fqdn(ctx: ServiceContext, configure: Callable[[AzContainerappShowSettings], AzContainerappShowSettings] | None=None) -> objectA container app's ingress FQDN. Pins
--query properties.configuration.ingress.fqdn --output tsv; fails for an app without ingress. -
static async containerapp_revision_list(ctx: ServiceContext, configure: Callable[[AzContainerappRevisionListSettings], AzContainerappRevisionListSettings] | None=None) -> ExecResultList a container app's revisions:
az containerapp revision list. -
static async containerapp_revision_activate(ctx: ServiceContext, configure: Callable[[AzContainerappRevisionSettings], AzContainerappRevisionSettings] | None=None) -> ExecResultActivate a revision:
az containerapp revision activate. -
static async containerapp_revision_deactivate(ctx: ServiceContext, configure: Callable[[AzContainerappRevisionSettings], AzContainerappRevisionSettings] | None=None) -> ExecResultDeactivate a revision:
az containerapp revision deactivate. -
static async containerapp_ingress_traffic_set(ctx: ServiceContext, configure: Callable[[AzContainerappIngressTrafficSetSettings], AzContainerappIngressTrafficSetSettings] | None=None) -> ExecResultSplit traffic between revisions or labels:
az containerapp ingress traffic set. -
static async webapp_deploy(ctx: ServiceContext, configure: Callable[[AzWebappDeploySettings], AzWebappDeploySettings] | None=None) -> ExecResultDeploy an artifact to a web app:
az webapp deploy. -
static async webapp_show(ctx: ServiceContext, configure: Callable[[AzWebappShowSettings], AzWebappShowSettings] | None=None) -> ExecResultDescribe a web app:
az webapp show. -
static async webapp_host_name(ctx: ServiceContext, configure: Callable[[AzWebappShowSettings], AzWebappShowSettings] | None=None) -> objectA web app's default host name. Pins
--query defaultHostName --output tsv. -
static async webapp_config_appsettings_set(ctx: ServiceContext, configure: Callable[[AzWebappConfigAppsettingsSetSettings], AzWebappConfigAppsettingsSetSettings] | None=None) -> ExecResultSet app settings:
az webapp config appsettings set. -
static async webapp_deployment_slot_swap(ctx: ServiceContext, configure: Callable[[AzWebappDeploymentSlotSwapSettings], AzWebappDeploymentSlotSwapSettings] | None=None) -> ExecResultSwap a deployment slot:
az webapp deployment slot swap. -
static async functionapp_deployment_source_config_zip(ctx: ServiceContext, configure: Callable[[AzFunctionappDeploymentSourceConfigZipSettings], AzFunctionappDeploymentSourceConfigZipSettings] | None=None) -> ExecResultDeploy a zip package to a function app:
az functionapp deployment source config-zip. -
static async keyvault_secret_show(ctx: ServiceContext, configure: Callable[[AzKeyvaultSecretShowSettings], AzKeyvaultSecretShowSettings] | None=None) -> ExecResultRead a secret:
az keyvault secret show(captured, never streamed). -
static async secret_value(ctx: ServiceContext, configure: Callable[[AzKeyvaultSecretShowSettings], AzKeyvaultSecretShowSettings] | None=None) -> objectA Key Vault secret's value, read back exactly — multi-line values and surrounding whitespace included — and registered as a secret. Pins
--query value --output json. -
static async keyvault_secret_set(ctx: ServiceContext, configure: Callable[[AzKeyvaultSecretSetSettings], AzKeyvaultSecretSetSettings] | None=None) -> ExecResultWrite a secret:
az keyvault secret set(captured, never streamed). -
static async deployment_group_create(ctx: ServiceContext, configure: Callable[[AzDeploymentGroupCreateSettings], AzDeploymentGroupCreateSettings] | None=None) -> ExecResultDeploy a template to a resource group:
az deployment group create. -
static async deployment_group_show(ctx: ServiceContext, configure: Callable[[AzDeploymentGroupShowSettings], AzDeploymentGroupShowSettings] | None=None) -> ExecResultDescribe a deployment:
az deployment group show. -
static async deployment_group_what_if(ctx: ServiceContext, configure: Callable[[AzDeploymentGroupWhatIfSettings], AzDeploymentGroupWhatIfSettings] | None=None) -> ExecResultPreview what a deployment would change:
az deployment group what-if. -
static async deployment_output(ctx: ServiceContext, group: str, name: str, key: str, configure: Callable[[AzDeploymentGroupShowSettings], AzDeploymentGroupShowSettings] | None=None) -> objectOne output of deployment
namein resource groupgroup, read back as a string — a non-string output as its JSON text. Pins--query properties.outputs --output json; fails when there is no such output. -
static async storage_blob_upload(ctx: ServiceContext, configure: Callable[[AzStorageBlobUploadSettings], AzStorageBlobUploadSettings] | None=None) -> ExecResultUpload a file to a blob:
az storage blob upload. -
static async storage_blob_download(ctx: ServiceContext, configure: Callable[[AzStorageBlobDownloadSettings], AzStorageBlobDownloadSettings] | None=None) -> ExecResultDownload a blob to a file:
az storage blob download. -
static async storage_blob_upload_batch(ctx: ServiceContext, configure: Callable[[AzStorageBlobUploadBatchSettings], AzStorageBlobUploadBatchSettings] | None=None) -> ExecResultUpload a directory:
az storage blob upload-batch. -
static async monitor_metrics_list(ctx: ServiceContext, configure: Callable[[AzMonitorMetricsListSettings], AzMonitorMetricsListSettings] | None=None) -> ExecResultRead a resource's metrics:
az monitor metrics list. -
static async metric_value(ctx: ServiceContext, configure: Callable[[AzMonitorMetricValueSettings], AzMonitorMetricValueSettings]) -> objectOne number from Azure Monitor: the latest datapoint of a metric, or an aggregate over the range. Pins
--query value --output json; fails on no data unless.missingDataAs(value)says what it means. -
static async monitor_metrics_list_definitions(ctx: ServiceContext, configure: Callable[[AzMonitorMetricsListDefinitionsSettings], AzMonitorMetricsListDefinitionsSettings] | None=None) -> ExecResultList a resource's metric definitions:
az monitor metrics list-definitions. -
static async monitor_metrics_alert_list(ctx: ServiceContext, configure: Callable[[AzMonitorMetricsAlertListSettings], AzMonitorMetricsAlertListSettings] | None=None) -> ExecResultList metric alert rules:
az monitor metrics alert list. -
static async monitor_metrics_alert_show(ctx: ServiceContext, configure: Callable[[AzMonitorMetricsAlertShowSettings], AzMonitorMetricsAlertShowSettings] | None=None) -> ExecResultDescribe a metric alert rule:
az monitor metrics alert show. -
static async monitor_activity_log_list(ctx: ServiceContext, configure: Callable[[AzMonitorActivityLogListSettings], AzMonitorActivityLogListSettings] | None=None) -> ExecResultList activity-log events:
az monitor activity-log list. -
static async monitor_log_analytics_query(ctx: ServiceContext, configure: Callable[[AzMonitorLogAnalyticsQuerySettings], AzMonitorLogAnalyticsQuerySettings] | None=None) -> ExecResultRun a KQL query:
az monitor log-analytics query(thelog-analyticsextension). -
static async log_analytics_query(ctx: ServiceContext, configure: Callable[[AzMonitorLogAnalyticsQuerySettings], AzMonitorLogAnalyticsQuerySettings]) -> objectThe rows of a KQL query, every cell a string. Pins
--output jsonand the whole answer as the query.
class AzWebappConfigAppsettingsSetSettings(AzResourceSettings) Settings for az webapp config appsettings set.
Each setting's value is part of the argv, so it is visible in the process table and in the command line the build logs; a credential belongs in Key Vault, referenced with keyVaultReference. A value that starts with @ is otherwise refused, because the CLI would read it from a file. The CLI's answer lists every setting with its value redacted.
-
setting(name: str, value: str) -> SelfAn app setting (
--settings name=value); repeatable. -
key_vault_reference(name: str, secret_uri: str) -> SelfAn app setting whose value App Service reads from Key Vault; repeatable. Sent as the JSON object
{"name":"@Microsoft.KeyVault(SecretUri=<uri>)"}, a form--settingsaccepts: written asname=@Microsoft…the CLI would first try to read a file of that name, and send its contents if one existed. -
slot_setting(name: str, value: str) -> SelfA setting that stays with its slot through a swap (
--slot-settings name=value); repeatable. -
slot(name: str) -> SelfA slot instead of production (
--slot).
class AzWebappDeploymentSlotSwapSettings(AzResourceSettings) Settings for az webapp deployment slot swap: swap a slot with production, or with targetSlot.
-
slot(name: str) -> SelfThe slot to swap from (
--slot). -
target_slot(name: str) -> SelfThe slot to swap with; production by default (
--target-slot). -
action(action: Literal['swap', 'preview', 'reset']) -> Selfpreviewapplies the target's settings to the source first,swapcompletes the swap,resetcancels a preview (--action). -
preserve_vnet(value: bool) -> SelfKeep the virtual network with the slot (
--preserve-vnet).
class AzWebappDeploySettings(AzResourceSettings) Settings for az webapp deploy, the current deploy command (the older webapp deployment source config-zip is deprecated in its favour).
-
src_path(path: str) -> SelfThe artifact to deploy, a local path (
--src-path). -
src_url(url: str) -> SelfThe artifact to deploy, a URL the app pulls it from (
--src-url). -
type_(type_: Literal['war', 'jar', 'ear', 'lib', 'startup', 'static', 'zip']) -> SelfThe artifact's type, when its extension does not say (
--type). -
target_path(path: str) -> SelfWhere to deploy it, an absolute path on the app (
--target-path). -
slot(name: str) -> SelfThe slot to deploy to; production when omitted (
--slot). -
async_(value: bool | None=None) -> SelfReturn once the artifact is pushed, without waiting for it to deploy (
--async). -
restart(value: bool) -> SelfRestart the app after deploying (
--restart); the CLI's default is to. -
clean(value: bool) -> SelfEmpty the target directory first (
--clean). -
timeout(ms: float) -> SelfHow long to wait for the deployment, in milliseconds (
--timeout).
class AzWebappShowSettings(AzResourceSettings) Settings for az webapp show.
-
slot(name: str) -> SelfA slot instead of production (
--slot).