CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-azure-mgmt-containerregistry

Microsoft Azure Container Registry Client Library for managing container registries, replications, webhooks, and access control through Azure Resource Manager APIs.

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

registry-management.mddocs/

Registry Management

Core container registry lifecycle management including creation, configuration, updates, deletion, and administrative operations. Supports all registry SKUs (Basic, Standard, Premium) and advanced features like geo-replication, networking controls, encryption, and content trust policies.

Capabilities

Registry Creation and Management

Create, update, and delete Azure Container Registries with comprehensive configuration options including SKU selection, administrative settings, and advanced features.

def begin_create(resource_group_name: str, registry_name: str, registry: Registry, **kwargs) -> LROPoller[Registry]:
    """
    Create or update a container registry.
    
    Parameters:
    - resource_group_name: str - Name of the resource group
    - registry_name: str - Name of the registry
    - registry: Registry - Registry resource parameters
    
    Returns:
    LROPoller[Registry] - Long-running operation poller for the registry
    """

def begin_delete(resource_group_name: str, registry_name: str, **kwargs) -> LROPoller[None]:
    """
    Delete a container registry.
    
    Parameters:
    - resource_group_name: str - Name of the resource group
    - registry_name: str - Name of the registry
    
    Returns:
    LROPoller[None] - Long-running operation poller
    """

def begin_update(resource_group_name: str, registry_name: str, registry_update_parameters: RegistryUpdateParameters, **kwargs) -> LROPoller[Registry]:
    """
    Update a container registry.
    
    Parameters:
    - resource_group_name: str - Name of the resource group
    - registry_name: str - Name of the registry
    - registry_update_parameters: RegistryUpdateParameters - Registry update parameters
    
    Returns:
    LROPoller[Registry] - Long-running operation poller for the updated registry
    """

Registry Information and Status

Retrieve registry details, list registries, and check registry status and configuration.

def get(resource_group_name: str, registry_name: str, **kwargs) -> Registry:
    """
    Get properties of a container registry.
    
    Parameters:
    - resource_group_name: str - Name of the resource group
    - registry_name: str - Name of the registry
    
    Returns:
    Registry - Registry resource with complete configuration
    """

def list(**kwargs) -> ItemPaged[Registry]:
    """
    List all container registries in the subscription.
    
    Returns:
    ItemPaged[Registry] - Paginated list of all registries
    """

def list_by_resource_group(resource_group_name: str, **kwargs) -> ItemPaged[Registry]:
    """
    List all container registries in a resource group.
    
    Parameters:
    - resource_group_name: str - Name of the resource group
    
    Returns:
    ItemPaged[Registry] - Paginated list of registries in the resource group
    """

Name Availability and Validation

Check registry name availability before creation to ensure unique naming requirements are met.

def check_name_availability(registry_name_check_request: RegistryNameCheckRequest, **kwargs) -> RegistryNameStatus:
    """
    Check if a registry name is available for use.
    
    Parameters:
    - registry_name_check_request: RegistryNameCheckRequest - Name availability check request
    
    Returns:
    RegistryNameStatus - Name availability result with reason if unavailable
    """

Administrative Credentials

Manage registry admin credentials for direct Docker CLI access, including credential retrieval and regeneration.

def list_credentials(resource_group_name: str, registry_name: str, **kwargs) -> RegistryListCredentialsResult:
    """
    List admin credentials for a container registry.
    
    Parameters:
    - resource_group_name: str - Name of the resource group
    - registry_name: str - Name of the registry
    
    Returns:
    RegistryListCredentialsResult - Registry admin username and passwords
    """

def regenerate_credential(resource_group_name: str, registry_name: str, regenerate_credential_parameters: RegenerateCredentialParameters, **kwargs) -> RegistryListCredentialsResult:
    """
    Regenerate one of the admin passwords for a container registry.
    
    Parameters:
    - resource_group_name: str - Name of the resource group
    - registry_name: str - Name of the registry
    - regenerate_credential_parameters: RegenerateCredentialParameters - Password name to regenerate
    
    Returns:
    RegistryListCredentialsResult - Updated registry credentials
    """

def begin_generate_credentials(resource_group_name: str, registry_name: str, generate_credentials_parameters: GenerateCredentialsParameters, **kwargs) -> LROPoller[GenerateCredentialsResult]:
    """
    Generate credentials for a container registry with the specified parameters.
    
    Parameters:
    - resource_group_name: str - Name of the resource group
    - registry_name: str - Name of the registry
    - generate_credentials_parameters: GenerateCredentialsParameters - Credential generation parameters
    
    Returns:
    LROPoller[GenerateCredentialsResult] - Long-running operation for credential generation
    """

Usage Metrics and Monitoring

Retrieve registry usage information including storage utilization and webhook count metrics.

def list_usages(resource_group_name: str, registry_name: str, **kwargs) -> RegistryUsageListResult:
    """
    Get quota usages for a container registry.
    
    Parameters:
    - resource_group_name: str - Name of the resource group
    - registry_name: str - Name of the registry
    
    Returns:
    RegistryUsageListResult - Current usage metrics for the registry
    """

Image Import Operations

Import container images from external registries or other Azure Container Registries.

def begin_import_image(resource_group_name: str, registry_name: str, parameters: ImportImageParameters, **kwargs) -> LROPoller[None]:
    """
    Copy an image from another registry into this registry.
    
    Parameters:
    - resource_group_name: str - Name of the resource group
    - registry_name: str - Name of the registry
    - parameters: ImportImageParameters - Import operation parameters
    
    Returns:
    LROPoller[None] - Long-running operation poller for the import
    """

Private Link Resources

Manage private link resources for private endpoint connectivity to the registry.

def list_private_link_resources(resource_group_name: str, registry_name: str, **kwargs) -> PrivateLinkResourceListResult:
    """
    List private link resources for a container registry.
    
    Parameters:
    - resource_group_name: str - Name of the resource group
    - registry_name: str - Name of the registry
    
    Returns:
    PrivateLinkResourceListResult - Available private link resources
    """

def get_private_link_resource(resource_group_name: str, registry_name: str, group_name: str, **kwargs) -> PrivateLinkResource:
    """
    Get a private link resource by name for a container registry.
    
    Parameters:
    - resource_group_name: str - Name of the resource group
    - registry_name: str - Name of the registry
    - group_name: str - Name of the private link resource
    
    Returns:
    PrivateLinkResource - Private link resource details
    """

Core Model Types

Registry

class Registry:
    """
    An object that represents a container registry.
    
    Attributes:
    - id: str - Resource ID
    - name: str - Resource name
    - type: str - Resource type
    - location: str - Resource location
    - tags: Dict[str, str] - Resource tags
    - sku: Sku - Registry SKU configuration
    - login_server: str - Registry login server URL
    - creation_date: datetime - Creation timestamp
    - provisioning_state: ProvisioningState - Current provisioning state
    - status: Status - Registry status information
    - admin_user_enabled: bool - Enable admin user account
    - storage_account: StorageAccountProperties - Storage account details (Legacy)
    - network_rule_set: NetworkRuleSet - Network access rules
    - policies: Policies - Registry policies configuration
    - encryption: EncryptionProperty - Encryption configuration
    - data_endpoint_enabled: bool - Enable dedicated data endpoints
    - data_endpoint_host_names: List[str] - Data endpoint host names
    - private_endpoint_connections: List[PrivateEndpointConnection] - Private endpoints
    - public_network_access: PublicNetworkAccess - Public network access setting
    - network_rule_bypass_options: NetworkRuleBypassOptions - Network rule bypass
    - zone_redundancy: ZoneRedundancy - Zone redundancy setting
    - anonymous_pull_enabled: bool - Enable anonymous pull
    """

RegistryUpdateParameters

class RegistryUpdateParameters:
    """
    Parameters for updating a container registry.
    
    Attributes:
    - tags: Dict[str, str] - Resource tags
    - sku: Sku - Registry SKU
    - admin_user_enabled: bool - Enable admin user
    - network_rule_set: NetworkRuleSet - Network access rules
    - policies: Policies - Registry policies
    - encryption: EncryptionProperty - Encryption settings
    - data_endpoint_enabled: bool - Enable data endpoints
    - public_network_access: PublicNetworkAccess - Public access setting
    - network_rule_bypass_options: NetworkRuleBypassOptions - Network bypass options
    - anonymous_pull_enabled: bool - Enable anonymous pull
    """

Sku

class Sku:
    """
    SKU properties of a container registry.
    
    Attributes:
    - name: SkuName - SKU name (Basic, Standard, Premium)
    - tier: SkuTier - SKU tier (Basic, Standard, Premium)
    """

RegistryNameCheckRequest

class RegistryNameCheckRequest:
    """
    Request to check registry name availability.
    
    Attributes:
    - name: str - Registry name to check
    - type: str - Resource type (always 'Microsoft.ContainerRegistry/registries')
    """

RegistryNameStatus

class RegistryNameStatus:
    """
    Result of registry name availability check.
    
    Attributes:
    - name_available: bool - Whether the name is available
    - reason: str - Reason if name is unavailable
    - message: str - Detailed message about availability
    """

ImportImageParameters

class ImportImageParameters:
    """
    Parameters for importing an image.
    
    Attributes:
    - source: ImportSource - Source registry information
    - target_tags: List[str] - Target tags for the imported image
    - target_repository: str - Target repository name
    - untagged_target_repositories: List[str] - Repositories for untagged imports
    - mode: ImportMode - Import mode (NoForce, Force)
    """

GenerateCredentialsParameters

class GenerateCredentialsParameters:
    """
    Parameters for generating credentials.
    
    Attributes:
    - token_id: str - Token ID for credential generation
    - expiry: datetime - Credential expiry time
    - name: TokenPasswordName - Password name (password1, password2)
    """

Usage Examples

Create a Premium Registry with Advanced Features

from azure.mgmt.containerregistry import ContainerRegistryManagementClient
from azure.mgmt.containerregistry.models import (
    Registry, Sku, SkuName, NetworkRuleSet, DefaultAction,
    EncryptionProperty, KeyVaultProperties, Policies, TrustPolicy, PolicyStatus
)
from azure.identity import DefaultAzureCredential

client = ContainerRegistryManagementClient(
    DefaultAzureCredential(), 
    "subscription-id"
)

# Create a Premium registry with advanced features
registry_params = Registry(
    location="East US",
    sku=Sku(name=SkuName.PREMIUM),
    admin_user_enabled=False,
    network_rule_set=NetworkRuleSet(
        default_action=DefaultAction.DENY,
        ip_rules=[
            {"action": "Allow", "ip_address_or_range": "203.0.113.0/24"}
        ]
    ),
    policies=Policies(
        trust_policy=TrustPolicy(
            type="Notary",
            status=PolicyStatus.ENABLED
        )
    ),
    public_network_access="Disabled",
    zone_redundancy="Enabled"
)

# Start registry creation
creation_poller = client.registries.begin_create(
    "my-resource-group",
    "my-premium-registry",
    registry_params
)

# Wait for completion
registry = creation_poller.result()
print(f"Created registry: {registry.login_server}")

Manage Registry Credentials

# Get current admin credentials
credentials = client.registries.list_credentials(
    "my-resource-group", 
    "my-registry"
)
print(f"Username: {credentials.username}")
print(f"Password 1: {credentials.passwords[0].value}")

# Regenerate password2
from azure.mgmt.containerregistry.models import RegenerateCredentialParameters, PasswordName

regen_params = RegenerateCredentialParameters(name=PasswordName.PASSWORD2)
new_credentials = client.registries.regenerate_credential(
    "my-resource-group",
    "my-registry", 
    regen_params
)
print(f"New password 2: {new_credentials.passwords[1].value}")

Import Image from Another Registry

from azure.mgmt.containerregistry.models import ImportImageParameters, ImportSource

import_params = ImportImageParameters(
    source=ImportSource(
        registry_uri="mcr.microsoft.com",
        source_image="dotnet/runtime:6.0"
    ),
    target_tags=["dotnet/runtime:6.0", "dotnet/runtime:latest"],
    mode="NoForce"
)

import_poller = client.registries.begin_import_image(
    "my-resource-group",
    "my-registry",
    import_params
)

import_poller.result()  # Wait for import completion
print("Image import completed successfully")

Install with Tessl CLI

npx tessl i tessl/pypi-azure-mgmt-containerregistry

docs

access-control.md

cache-and-credentials.md

connected-registries.md

index.md

private-networking.md

registry-management.md

replication-management.md

webhook-management.md

tile.json