page_type | languages | products | urlFragment | |||
---|---|---|---|---|---|---|
sample |
|
|
containerregistry-samples |
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 |
- Python 3.8 or later is required to use this package.
- You need an Azure subscription and a Container Registry account to use this package.
- Install the Azure Container Registry client library for Python with pip:
pip install --pre azure-containerregistry
- Clone or download this sample repository
- Open the sample folder in Visual Studio Code or your IDE of choice.
- Open a terminal window and
cd
to the directory that the samples are saved in. - Set the environment variables specified in the sample file you wish to run.
- Follow the usage described in the file, e.g.
python sample_hello_world.py
Check out the API reference documentation to learn more about what you can do with the Azure Container Registry client library.