Skip to main content

Microsoft Azure Azure Container Registry Client Library for Python

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

azure-containerregistry-1.0.0b3.zip (100.1 kB view details)

Uploaded Source

Built Distribution

azure_containerregistry-1.0.0b3-py2.py3-none-any.whl (71.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file azure-containerregistry-1.0.0b3.zip.

File metadata

  • Download URL: azure-containerregistry-1.0.0b3.zip
  • Upload date:
  • Size: 100.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for azure-containerregistry-1.0.0b3.zip
Algorithm Hash digest
SHA256 3e604501e9fc4b408f404e842fc82b9544c4b4c3296eb5db760b112147f9a839
MD5 2bff395a5208a07a02ab0c9fa0a1dc50
BLAKE2b-256 55403e5c5196b297d9ff26107df0bb8452223433c74f19003506de6afc0db7ea

See more details on using hashes here.

File details

Details for the file azure_containerregistry-1.0.0b3-py2.py3-none-any.whl.

File metadata

  • Download URL: azure_containerregistry-1.0.0b3-py2.py3-none-any.whl
  • Upload date:
  • Size: 71.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for azure_containerregistry-1.0.0b3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c092ab8b1fc7806a046bb903d36d8e5425b2beb70b35219d1e51823f0a6333f1
MD5 7c381b699cb1a0a7d319f857959bb2d8
BLAKE2b-256 fd6a0540f5a79912a144b536405acde57bdb36b321804779b1db4eff273cca5b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page