Import-AzContainerRegistryImage

Import image from a public/azure registry to an azure container registry.

Note

This is the previous version of our documentation. Please consult the most recent version for up-to-date information.

Syntax

Import-AzContainerRegistryImage
      -ResourceGroupName <String>
      -RegistryName <String>
      -SourceImage <String>
      -SourceRegistryResourceId <String>
      [-Mode <String>]
      [-TargetTag <String[]>]
      [-UntaggedTargetRepository <String[]>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Import-AzContainerRegistryImage
      -ResourceGroupName <String>
      -RegistryName <String>
      -SourceImage <String>
      -SourceRegistryResourceId <String>
      [-Mode <String>]
      [-TargetTag <String[]>]
      [-UntaggedTargetRepository <String[]>]
      [-Username <String>]
      -Password <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Import-AzContainerRegistryImage
      -ResourceGroupName <String>
      -RegistryName <String>
      -SourceImage <String>
      -SourceRegistryUri <String>
      [-Mode <String>]
      [-TargetTag <String[]>]
      [-UntaggedTargetRepository <String[]>]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Import-AzContainerRegistryImage
      -ResourceGroupName <String>
      -RegistryName <String>
      -SourceImage <String>
      -SourceRegistryUri <String>
      [-Mode <String>]
      [-TargetTag <String[]>]
      [-UntaggedTargetRepository <String[]>]
      [-Username <String>]
      -Password <String>
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Import image from a public/azure registry to an azure container registry.

Examples

Example 1

Import-AzContainerRegistryImage -SourceImage library/busybox:latest -ResourceGroupName $resourceGroupName -RegistryName $RegistryName -SourceRegistryUri docker.io -TargetTag busybox:latest

Import busybox to ACR. Note:

  • "library/" need to be add before source image. "busybox:latest" => "library/busybox:latest"
  • Credential needed if source registry is not publicly available

Example 2

Import-AzContainerRegistryImage -SourceImage $SourceRegistry.azurecr.io/busybox:latest -ResourceGroupName $resourceGroupName -RegistryName $RegistryName -SourceRegistryResourceId $SourceACRID -TargetTag busybox:latest

Import busybox from source ACR to target ACR. Note:

  • Credential needed if admin user for source registry was disabled.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Mode

When Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins.

Type:String
Accepted values:Force, NoForce
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Password

The password used to authenticate with the source registry.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-RegistryName

Target registry name.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ResourceGroupName

Resource group name.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SourceImage

Repository name of the source image.

Specify an image by repository ('hello-world'). This will use the 'latest' tag.

Specify an image by tag ('hello-world:latest').

Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123').

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-SourceRegistryResourceId

The resource identifier of the source Azure Container Registry.

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-SourceRegistryUri

The address of the source registry (e.g. 'mcr.microsoft.com').

Type:String
Position:Named
Default value:None
Accept pipeline input:True
Accept wildcard characters:False
-TargetTag

List of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted).

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-UntaggedTargetRepository

List of strings of repository names to do a manifest only copy. No tag will be created.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-Username

The username to authenticate with the source registry.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

Boolean