Registries - Import Image

Copies an image to this container registry from the specified container registry.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage?api-version=2023-01-01-preview

URI Parameters

Name In Required Type Description
registryName
path True

string

The name of the container registry.

Regex pattern: ^[a-zA-Z0-9]*$

resourceGroupName
path True

string

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string

uuid

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

The API version to use for this operation.

Request Body

Name Required Type Description
source True

ImportSource

The source of the image.

mode

ImportMode

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

targetTags

string[]

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).

untaggedTargetRepositories

string[]

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

Responses

Name Type Description
200 OK

The request was successful; the operation has completed successfully.

202 Accepted

The request was successful; the operation will complete asynchronously.

Headers

Location: string

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

ImportImageByManifestDigest
ImportImageByTag
ImportImageFromPublicRegistry

ImportImageByManifestDigest

Sample Request

POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importImage?api-version=2023-01-01-preview

{
  "source": {
    "resourceId": "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry",
    "sourceImage": "sourceRepository@sha256:0000000000000000000000000000000000000000000000000000000000000000"
  },
  "targetTags": [
    "targetRepository:targetTag"
  ],
  "untaggedTargetRepositories": [
    "targetRepository1"
  ],
  "mode": "Force"
}

Sample Response

Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/locations/location/operationResults/operationStatuses/registries-00000000-0000-0000-0000-000000000000?api-version=2023-01-01-preview

ImportImageByTag

Sample Request

POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importImage?api-version=2023-01-01-preview

{
  "source": {
    "resourceId": "/subscriptions/10000000-0000-0000-0000-000000000000/resourceGroups/sourceResourceGroup/providers/Microsoft.ContainerRegistry/registries/sourceRegistry",
    "sourceImage": "sourceRepository:sourceTag"
  },
  "targetTags": [
    "targetRepository:targetTag"
  ],
  "untaggedTargetRepositories": [
    "targetRepository1"
  ],
  "mode": "Force"
}

Sample Response

Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/locations/location/operationResults/operationStatuses/registries-00000000-0000-0000-0000-000000000000?api-version=2023-01-01-preview

ImportImageFromPublicRegistry

Sample Request

POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/importImage?api-version=2023-01-01-preview

{
  "source": {
    "registryUri": "registry.hub.docker.com",
    "sourceImage": "library/hello-world"
  },
  "targetTags": [
    "targetRepository:targetTag"
  ],
  "untaggedTargetRepositories": [
    "targetRepository1"
  ],
  "mode": "Force"
}

Sample Response

Location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/locations/location/operationResults/operationStatuses/registries-00000000-0000-0000-0000-000000000000?api-version=2023-01-01-preview

Definitions

Name Description
ImportImageParameters
ImportMode

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

ImportSource
ImportSourceCredentials

ImportImageParameters

Name Type Default Value Description
mode

ImportMode

NoForce

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

source

ImportSource

The source of the image.

targetTags

string[]

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).

untaggedTargetRepositories

string[]

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

ImportMode

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

Name Type Description
Force

string

NoForce

string

ImportSource

Name Type Description
credentials

ImportSourceCredentials

Credentials used when importing from a registry uri.

registryUri

string

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

resourceId

string

The resource identifier of the source Azure Container Registry.

sourceImage

string

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').

ImportSourceCredentials

Name Type Description
password

string

The password used to authenticate with the source registry.

username

string

The username to authenticate with the source registry.