Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
page_type languages products urlFragment
sample
python
azure
azure-container-registry
containerregistry-samples

Samples for Azure Container Registry

These code samples show common scenario operations with the Azure Container Registry client library. The code samples assume an environment variable CONTAINERREGISTRY_ENDPOINT is set, which includes the name of the login server and the https:// prefix. For more information on using AAD with Azure Container Registry, please see the service's Authentication Overview.

File Name Description
sample_hello_world.py (sample_hello_world_async.py) Instantiate a ContainerRegistryClient object and iterating through the collection of tags in the repository with anonymous access
sample_delete_tags.py (sample_delete_tags_async.py) Delete tags from a repository
sample_delete_images.py (sample_delete_images_async.py) Delete images from a repository
sample_set_image_properties.py (sample_set_image_properties_async.py) Set read/write/delete properties on an image
sample_list_tags.py (sample_list_tags_async.py) List tags on an image with anonymous access
sample_set_get_image.py (sample_set_get_image_async.py) Set and get a manifest, and upload and download a blob to and from a repository

Prerequisites

Setup

  1. Install the Azure Container Registry client library for Python with pip:
pip install --pre azure-containerregistry
  1. Clone or download this sample repository
  2. Open the sample folder in Visual Studio Code or your IDE of choice.

Running the samples

  1. Open a terminal window and cd to the directory that the samples are saved in.
  2. Set the environment variables specified in the sample file you wish to run.
  3. Follow the usage described in the file, e.g. python sample_hello_world.py

Next steps

Check out the API reference documentation to learn more about what you can do with the Azure Container Registry client library.