Skip to content
Latchkey

az extension add: Install CLI Extensions

az extension add installs an Azure CLI extension so its command group becomes available.

Newer command groups ship as extensions. Pinning and pre-installing them in CI avoids interactive install prompts and version drift between runs.

What it does

az extension add downloads and installs an extension (such as containerapp, ml, or aks-preview), adding its command group to the CLI. Without it, az auto-prompts to install on first use, which stalls a non-interactive job.

Common usage

Terminal
az extension add --name containerapp --upgrade
# pin a version for reproducible CI
az extension add --name containerapp --version 0.3.49
# allow unattended dynamic installs globally
az config set extension.use_dynamic_install=yes_without_prompt

Subcommands and flags

FlagWhat it does
--name, -nExtension to install
--upgradeInstall or upgrade to the latest version
--versionPin a specific extension version
--sourceInstall from a wheel URL or path
--allow-previewPermit preview extension versions

In CI

Pre-install required extensions at the top of the job with a pinned --version so runs are reproducible and never block on an install prompt. Alternatively set extension.use_dynamic_install=yes_without_prompt so first use installs silently. Pinning beats auto-install when you need a stable surface.

Common errors in CI

"The command requires the extension <x>. Do you want to install it now? (Y/n):" hanging means a non-interactive job with no dynamic install configured; pre-install or set the config flag. "No matching extensions for '<name>'" means a wrong name or a removed extension. A version conflict means an incompatible extension and core CLI pairing; upgrade the core CLI.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →