{"id":27603,"library":"azure-cli-acr","title":"Azure CLI ACR Command Module","description":"Microsoft Azure Command-Line Tools ACR Command Module. Manages Azure Container Registry resources including registries, repositories, tasks, and tokens. Part of the Azure CLI. Version 2.2.9. Release cadence tied to Azure CLI releases (approximately monthly).","status":"active","version":"2.2.9","language":"python","source_language":"en","source_url":"https://github.com/Azure/azure-cli","tags":["azure","acr","container-registry","docker","cli"],"install":[{"cmd":"pip install azure-cli-acr","lang":"bash","label":"Install via pip"},{"cmd":"az extension add --name acr","lang":"bash","label":"Install as Azure CLI extension"}],"dependencies":[{"reason":"Required for Azure CLI command infrastructure.","package":"azure-cli-core","optional":false},{"reason":"Provides the ACR management client.","package":"azure-mgmt-containerregistry","optional":false},{"reason":"Used for export/import operations.","package":"azure-storage-blob","optional":true}],"imports":[{"note":"Commands are loaded via the extension, but for programmatic access use this import.","symbol":"acr_commands","correct":"from azure.cli.command_modules.acr import acr_commands"},{"note":"Common mistake: importing the module instead of its contents.","wrong":"from azure.cli.command_modules.acr import custom","symbol":"custom","correct":"from azure.cli.command_modules.acr.custom import *"}],"quickstart":{"code":"import os\nfrom azure.cli.core import get_default_cli\n\ncli = get_default_cli()\nexit_code = cli.invoke(['acr', 'list', '--output', 'json'])\nif exit_code != 0:\n    print('List failed')\nelse:\n    import json\n    registries = json.loads(cli.result.result)\n    print(json.dumps(registries, indent=2))","lang":"python","description":"List all Azure Container Registries using the Azure CLI ACR module."},"warnings":[{"fix":"Use `az acr task create` and `az acr task run` to execute builds.","message":"The `az acr build` command with legacy parameters (e.g., `--dockerfile`) was refactored. Use `az acr task run` instead.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Always specify `--resource-group <name>` unless the command documentation explicitly says it's optional.","message":"The `--resource-group` parameter is being phased out in favor of `--resource-group`. Actually, `--resource-group` is required for most ACR commands but its omission is a common source of errors.","severity":"deprecated","affected_versions":"*"},{"fix":"Use `az acr import --source <registry>.azurecr.io/<repo>:<tag>`.","message":"When using `az acr import`, the source image must be in the format `registry.azurecr.io/repo:tag`. Omitting the full qualified name results in a `RegistryNotFound` error.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Verify the registry name and resource group using `az acr list --query \"[].{name:name, resourceGroup:resourceGroup}\"`.","cause":"Incorrect resource group or registry name, or registry not deployed.","error":"ResourceNotFoundError: The Resource 'Microsoft.ContainerRegistry/registries/<name>' under resource group '<rg>' was not found."},{"fix":"Run `az extension add --name acr` or install via `pip install azure-cli-acr`. Then restart the CLI.","cause":"The azure-cli-acr extension is not installed or loaded.","error":"The command is not recognized. Please validate it is available."},{"fix":"Check the correct parameters with `az acr <command> --help`.","cause":"Using an outdated parameter name (e.g., `--registry-name` instead of `--name`).","error":"error: unrecognized arguments: --<param>"},{"fix":"Run `az login` to re-authenticate and ensure you have the correct subscription `az account set --subscription <id>`.","cause":"Application with identifier was not found in the directory. Possibly the Azure CLI is not logged in or has a stale token.","error":"Login failed: AADSTS700016"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}