AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

azure-containerregistry-py

Azure Container Registry SDK for Python. Use for managing container images, artifacts, and repositories. Triggers: "azure-containerregistry", "ContainerRegistryClient", "container images", "docker registry", "ACR".

Original source
microsoft
License
MIT
Pinned revision
3f5b461b2314e01c400564051e92469114c5b68f

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

Ask your assistant

Use Agentic Memory skills to read microsoft--azure-containerregistry-py at revision 3f5b461b2314e01c400564051e92469114c5b68f, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 3

references/non-hero-scenarios.md

azure-containerregistry-py non-hero scenarios

These scenarios are intentionally separate from hero flows in SKILL.md. They cover secondary/advanced patterns typically used after the primary end-to-end path is working.

Tag Operations

Get Tag Properties

tag = client.get_tag_properties("my-image", "latest")
print(f"Digest: {tag.digest}")
print(f"Created: {tag.created_on}")

Delete Tag

client.delete_tag("my-image", "old-tag")

Upload and Download Artifacts

from azure.containerregistry import ContainerRegistryClient
from azure.identity import DefaultAzureCredential

with DefaultAzureCredential() as credential:
    with ContainerRegistryClient(endpoint, credential) as client:
        # 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)

Async Client

from azure.containerregistry.aio import ContainerRegistryClient
from azure.identity.aio import DefaultAzureCredential

async def list_repos():
    async with DefaultAzureCredential() as credential:
        async with ContainerRegistryClient(endpoint, credential) as client:
            async for repo in client.list_repository_names():
                print(repo)

Clean Up Old Images

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)

Client Operations

| 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 |