Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Azure Container Registry client library for Python

Azure Container Registry allows you to store and manage container images and artifacts in a private registry for all types of container deployments.

Use the client library for Azure Container Registry to:

  • List images or artifacts in a registry
  • Obtain metadata for images and artifacts, repositories and tags
  • Set read/write/delete properties on registry items
  • Delete images and artifacts, repositories and tags

Source code | Package (Pypi) | API reference documentation | REST API documentation | Product documentation

Getting started

Install the package

Install the Azure Container Registry client library for Python with pip:

pip install --pre azure-containerregistry

Prerequisites

You need an Azure subscription and a Container Registry account to use this package.

To create a new Container Registry, you can use the Azure Portal, Azure PowerShell, or the Azure CLI. Here's an example using the Azure CLI:

az acr create --name MyContainerRegistry --resource-group MyResourceGroup --location westus --sku Basic

Authenticate the client

The Azure Identity library provides easy Azure Active Directory support for authentication. The DefaultAzureCredential assumes the AZURE_CLIENT_ID, AZURE_TENANT_ID, and AZURE_CLIENT_SECRET environment variables are set, for more information refer to the Azure Identity environment variables section

# Create a ContainerRegistryClient that will authenticate through Active Directory
from azure.containerregistry import ContainerRegistryClient
from azure.identity import DefaultAzureCredential

account_url = "https://MYCONTAINERREGISTRY.azurecr.io"
client = ContainerRegistryClient(account_url, DefaultAzureCredential())

Key concepts

A registry stores Docker images and OCI Artifacts. An image or artifact consists of a manifest and layers. An image's manifest describes the layers that make up the image, and is uniquely identified by its digest. An image can also be "tagged" to give it a human-readable alias. An image or artifact can have zero or more tags associated with it, and each tag uniquely identifies the image. A collection of images that share the same name but have different tags, is referred to as a repository.

For more information please see Container Registry Concepts.

Examples

Troubleshooting

General

Form Recognizer client library will raise exceptions defined in Azure Core.

Logging

This library uses the standard logging library for logging.

Basic information about HTTP sessions (URLs, headers, etc.) is logged at INFO level.

Detailed DEBUG level logging, including request/response bodies and unredacted headers, can be enabled on the client or per-operation with the logging_enable keyword argument.

See full SDK logging documentation with examples here.

Optional Configuration

Optional keyword arguments can be passed in at the client and per-operation level. The azure-core reference documentation describes available configurations for retries, logging, transport protocols, and more.

Next steps

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit cla.microsoft.com.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Impressions

Release files for azure-containerregistry 1.0.0b4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for azure-containerregistry 1.0.0b4
File Size Uploaded
azure-containerregistry-1.0.0b4.zip 101.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for azure-containerregistry 1.0.0b4
File Interpreter ABI Platform
azure_containerregistry-1.0.0b4-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 172.0 kB

Release files / azure-containerregistry-1.0.0b4.zip

Download URL azure-containerregistry-1.0.0b4.zip
Size 101.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a63dee3df92885766a27f4dfae62ab5529e366984ba67d6b19fa4967f7421760
BLAKE2b-256 checksum
How to use checksums
cd14e0c1e71a2a00f6cd48b1a6da26a4266f94bf67be717f001aa50851fb3f9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

Release files / azure_containerregistry-1.0.0b4-py2.py3-none-any.whl

Download URL azure_containerregistry-1.0.0b4-py2.py3-none-any.whl
Size 70.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
560d97668bf30726b3e53460f2a56c8dd4cfff610f1367eb9ed6a4eeae622364
BLAKE2b-256 checksum
How to use checksums
8e8b977785d8f2e329815cfebf5ea3ef1c776c54690a34316010ca66586f8593
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page