Manages Azure Container Registry repositories, tags, and manifests using Python SDK. Includes Entra ID authentication, listing with ordering, properties, updates, and deletions.
From antigravity-awesome-skillsnpx claudepluginhub sickn33/antigravity-awesome-skills --plugin antigravity-awesome-skillsThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Manage container images, artifacts, and repositories in Azure Container Registry.
pip install azure-containerregistry
AZURE_CONTAINERREGISTRY_ENDPOINT=https://<registry-name>.azurecr.io
from azure.containerregistry import ContainerRegistryClient
from azure.identity import DefaultAzureCredential
client = ContainerRegistryClient(
endpoint=os.environ["AZURE_CONTAINERREGISTRY_ENDPOINT"],
credential=DefaultAzureCredential()
)
from azure.containerregistry import ContainerRegistryClient
client = ContainerRegistryClient(
endpoint="https://mcr.microsoft.com",
credential=None,
audience="https://mcr.microsoft.com"
)
client = ContainerRegistryClient(endpoint, DefaultAzureCredential())
for repository in client.list_repository_names():
print(repository)
properties = client.get_repository_properties("my-image")
print(f"Created: {properties.created_on}")
print(f"Modified: {properties.last_updated_on}")
print(f"Manifests: {properties.manifest_count}")
print(f"Tags: {properties.tag_count}")
from azure.containerregistry import RepositoryProperties
client.update_repository_properties(
"my-image",
properties=RepositoryProperties(
can_delete=False,
can_write=False
)
)
client.delete_repository("my-image")
for tag in client.list_tag_properties("my-image"):
print(f"{tag.name}: {tag.created_on}")
from azure.containerregistry import ArtifactTagOrder
# Most recent first
for tag in client.list_tag_properties(
"my-image",
order_by=ArtifactTagOrder.LAST_UPDATED_ON_DESCENDING
):
print(f"{tag.name}: {tag.last_updated_on}")
from azure.containerregistry import ArtifactManifestOrder
for manifest in client.list_manifest_properties(
"my-image",
order_by=ArtifactManifestOrder.LAST_UPDATED_ON_DESCENDING
):
print(f"Digest: {manifest.digest}")
print(f"Tags: {manifest.tags}")
print(f"Size: {manifest.size_in_bytes}")
manifest = client.get_manifest_properties("my-image", "latest")
print(f"Digest: {manifest.digest}")
print(f"Architecture: {manifest.architecture}")
print(f"OS: {manifest.operating_system}")
from azure.containerregistry import ArtifactManifestProperties
client.update_manifest_properties(
"my-image",
"latest",
properties=ArtifactManifestProperties(
can_delete=False,
can_write=False
)
)
# Delete by digest
client.delete_manifest("my-image", "sha256:abc123...")
# Delete by tag
manifest = client.get_manifest_properties("my-image", "old-tag")
client.delete_manifest("my-image", manifest.digest)
tag = client.get_tag_properties("my-image", "latest")
print(f"Digest: {tag.digest}")
print(f"Created: {tag.created_on}")
client.delete_tag("my-image", "old-tag")
from azure.containerregistry import ContainerRegistryClient
client = ContainerRegistryClient(endpoint, DefaultAzureCredential())
# Download manifest
manifest = client.download_manifest("my-image", "latest")
print(f"Media type: {manifest.media_type}")
print(f"Digest: {manifest.digest}")
# Download blob
blob = client.download_blob("my-image", "sha256:abc123...")
with open("layer.tar.gz", "wb") as f:
for chunk in blob:
f.write(chunk)
from azure.containerregistry.aio import ContainerRegistryClient
from azure.identity.aio import DefaultAzureCredential
async def list_repos():
credential = DefaultAzureCredential()
client = ContainerRegistryClient(endpoint, credential)
async for repo in client.list_repository_names():
print(repo)
await client.close()
await credential.close()
from datetime import datetime, timedelta, timezone
cutoff = datetime.now(timezone.utc) - timedelta(days=30)
for manifest in client.list_manifest_properties("my-image"):
if manifest.last_updated_on < cutoff and not manifest.tags:
print(f"Deleting {manifest.digest}")
client.delete_manifest("my-image", manifest.digest)
| Operation | Description |
|---|---|
list_repository_names | List all repositories |
get_repository_properties | Get repository metadata |
delete_repository | Delete repository and all images |
list_tag_properties | List tags in repository |
get_tag_properties | Get tag metadata |
delete_tag | Delete specific tag |
list_manifest_properties | List manifests in repository |
get_manifest_properties | Get manifest metadata |
delete_manifest | Delete manifest by digest |
download_manifest | Download manifest content |
download_blob | Download layer blob |
This skill is applicable to execute the workflow or actions described in the overview.