You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/container-registry/container-registry-transfer-images.md
+45-35Lines changed: 45 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,30 +2,30 @@
2
2
title: Transfer images
3
3
description: Transfer images in bulk from one container registry to another registry by creating a transfer pipeline using Azure storage accounts
4
4
ms.topic: article
5
-
ms.date: 04/06/2020
5
+
ms.date: 04/07/2020
6
6
ms.custom:
7
7
---
8
8
9
-
# Transfer images to another registry
9
+
# Transfer artifacts to another registry
10
10
11
11
This article shows how to transfer images or other registry artifacts in bulk from one Azure container registry to another registry. The source and target registries can be in the same or different subscriptions, or potentially different Active Directory tenants or Azure clouds.
12
12
13
-
To transfer images, you create a *transfer pipeline* that replicates artifacts between registries by using blob storage:
13
+
To transfer artifacts, you create a *transfer pipeline* that replicates artifacts between registries by using blob storage:
14
14
15
-
*Images from a source registry are packaged into a blob placed in a source storage account
15
+
*Artifacts from a source registry are exported to a blob in a source storage account
16
16
* The blob is copied from the source storage account to a target storage account
17
-
* The blob in the target storage account gets unpacked into artifacts in the target registry. You can set up the import pipeline to trigger whenever the image blob updates in the target storage.
17
+
* The blob in the target storage account gets imported as artifacts in the target registry. You can set up the import pipeline to trigger whenever the artifact blob updates in the target storage.
18
18
19
-
Transferring registry images is a more general, scalable alternative to [importing images](container-registry-import-images.md) from one container registry to another.
19
+
Transferring registry artifacts is a more general, scalable alternative to [importing images](container-registry-import-images.md) from one container registry to another.
20
20
21
21
In this article, you use the Azure CLI and Azure Resource Manager templates to create the resources and transfer pipeline. If you need to install or upgrade the CLI, see [Install Azure CLI][azure-cli].
22
22
23
23
This feature is available in the **Premium** container registry service tier. For information about registry service tiers and limits, see [Azure Container Registry SKUs](container-registry-skus.md).
24
24
25
25
## Prerequisites
26
26
27
-
***Container registries** - You need an existing source registry with images to transfer, and a target registry. The source and target registries can be in the same or a different Azure subscription, Active Directory tenant, or cloud. If you need to create a registry, see [Quickstart: Create a private container registry using the Azure CLI](container-registry-get-started-azure-cli.md).
28
-
***Storage accounts** - Create source and target storage accounts in a subscription and location of your choice. If needed, create the storage accounts with the [Azure CLI](../storage/common/storage-account-create.md?tabs=azure-cli) or other tools. In each account, create a blob container for image transfer. For example, create a container named *transfer*.
27
+
***Container registries** - You need an existing source registry with artifacts to transfer, and a target registry. The source and target registries can be in the same or a different Azure subscription, Active Directory tenant, or cloud. If you need to create a registry, see [Quickstart: Create a private container registry using the Azure CLI](container-registry-get-started-azure-cli.md).
28
+
***Storage accounts** - Create source and target storage accounts in a subscription and location of your choice. If needed, create the storage accounts with the [Azure CLI](../storage/common/storage-account-create.md?tabs=azure-cli) or other tools. In each account, create a blob container for artifact transfer. For example, create a container named *transfer*.
29
29
***Key vaults** Create key vaults to store secrets in the same Azure subscription or subscriptions as your source and target registries. If needed, create source and target key vaults with the [Azure CLI](../key-vault/quick-create-cli.md) or other tools.
30
30
31
31
> [!NOTE]
@@ -38,21 +38,20 @@ You create the following three resources for ACR Transfer. All are created using
38
38
***ExportPipeline** - Long-lasting resource that contains high-level information about the *source* registry and storage account. This information includes the source storage blob container URI and the key vault secret URI of the storage SAS token.
39
39
***ImportPipeline** - Long-lasting resource that contains high-level information about the *target* registry and storage account. This information includes the target storage blob container URI and the key vault secret URI of the storage SAS token. An import trigger is enabled by default, so the pipeline runs automatically when artifacts land in the target storage container.
40
40
***PipelineRun** - Resource used to invoke either an ExportPipeline or ImportPipeline resource.
41
-
You run the ExportPipeline manually by creating a PipelineRun resource and specify the artifacts to export.
42
-
43
-
If an import trigger is enabled, an ImportPipeline runs automatically. It can also be run manually using a PipelineRun.
41
+
* You run the ExportPipeline manually by creating a PipelineRun resource and specify the artifacts to export.
42
+
* If an import trigger is enabled, the ImportPipeline runs automatically. It can also be run manually using a PipelineRun.
44
43
45
44
### Things to know
46
45
* The ImportPipeline and ExportPipeline may be located in different Active Directory tenants, or different Azure clouds. If run in different tenants or clouds, you need separate managed identities and key vaults for the export and import resources.
47
46
* ExportPipelines and ImportPipelines also support system-assigned identities. In this case, assign the identity permissions to your key vault after the ExportPipeline resource is created and before running.
48
47
49
48
## Create and store SAS tokens
50
49
51
-
Transfer uses shared access signature (SAS) tokens to export to and import from the designated storage accounts. The properties required to create SAS tokens are detailed below.
50
+
Transfer uses shared access signature (SAS) tokens to export to and import from the designated storage accounts. Generate SAS tokens as described in the following sections.
52
51
53
52
### SAS token for export
54
53
55
-
Generate a SAS token for export to the source storage account.
54
+
Generate a SAS token for the source storage account, used for artifact export.
Generate a SAS token for import from the target storage account.
88
+
Generate a SAS token for the target storage account, used for artifact import.
90
89
91
90
SAS properties:
92
91
***Allowed services** - Blob
@@ -175,7 +174,7 @@ az keyvault set-policy --name targetkeyvault \
175
174
176
175
### Create the ExportPipeline resource
177
176
178
-
Create an ExportPipeline resource for your source container registry using Azure Resource Manager template deployment. The ExportPipeline resource is provisioned with the source user-assigned identity you created previously.
177
+
Create an ExportPipeline resource for your source container registry using Azure Resource Manager template deployment. The ExportPipeline resource is provisioned with the source user-assigned identity you created in the previous section.
179
178
180
179
Copy ExportPipeline Resource Manager template files from [here](add link - TBD).
181
180
@@ -185,8 +184,8 @@ Enter the following parameter values in the file `azuredeploy.parameters.json`:
185
184
|---------|---------|
186
185
|registryName | Name of your source container registry |
187
186
|exportPipelineName | Name you choose for the export pipeline |
188
-
|targetUri | URI of the container in your source storage account.Example: `https://sourcestorage.blob.core.windows.net/transfer`|
189
-
|keyVaultUri | URI of the SAS token secret in the source key vault.Example: `https://sourcevault.vault-int.azure-int.net/secrets/acrexportsas/xxxxxxxxxx`|
187
+
|targetUri | URI of the container in your source storage account.<br/>Example: `https://sourcestorage.blob.core.windows.net/transfer`|
188
+
|keyVaultUri | URI of the SAS token secret in the source key vault.<br/>Example: `https://sourcevault.vault-int.azure-int.net/secrets/acrexportsas/xxxxxxxxxx`|
190
189
191
190
Run [az deployment group create][az-deployment-group-create] to create the resource.
192
191
@@ -206,7 +205,7 @@ Take note of the resource ID (`id`) of the pipeline, which is used in later step
206
205
207
206
### Run the ExportPipeline resource
208
207
209
-
Create a PipelineRun resource for your source container registry using Azure Resource Manager template deployment. This resource runs the ExportPipeline resource you created in the previous step, and exports specified images from your container registry to your source storage account. As shown in a later step, you can also use a PipelineRun resource to trigger an ImportPipeline for image import to your target container registry.
208
+
Create a PipelineRun resource for your source container registry using Azure Resource Manager template deployment. This resource runs the ExportPipeline resource you created in the previous step, and exports specified artifacts from your container registry to your source storage account.
210
209
211
210
Copy ExportPipeline Resource Manager template files from [here](add link - TBD).
212
211
@@ -216,11 +215,11 @@ Enter the following parameter values in the file `azuredeploy.parameters.json`:
216
215
|---------|---------|
217
216
|registryName | Name of your source container registry |
218
217
|pipelineRunName | Name you choose for the run |
219
-
|pipelineResourceId | Resource ID of the export pipeline.Example: `/subscriptions/<subscriptionID>/resourceGroups/<resourceGroupName>/providers/Microsoft.ContainerRegistry/registries/<sourceRegistryName>/exportPipelines/myExportPipeline`|
220
-
|targetName | Name you choose for the artifacts blob exported to your source storage account, such a*myblob*
221
-
|artifacts | Array of source images to transfer.Example: `[samples/hello-world:v1", "samples/nginx:v1"]`
218
+
|pipelineResourceId | Resource ID of the export pipeline.<br/>Example: `/subscriptions/<subscriptionID>/resourceGroups/<resourceGroupName>/providers/Microsoft.ContainerRegistry/registries/<sourceRegistryName>/exportPipelines/myExportPipeline`|
219
+
|targetName | Name you choose for the artifacts blob exported to your source storage account, such as*myblob*
220
+
|artifacts | Array of source artifacts to transfer.<br/>Example: `[samples/hello-world:v1", "samples/nginx:v1"]`
222
221
223
-
Run [az deployment group create][az-deployment-group-create] to run the resource.
222
+
Run [az deployment group create][az-deployment-group-create] to create the PipelineRun resource.
224
223
225
224
```azurecli
226
225
az deployment group create \
@@ -229,13 +228,14 @@ az deployment group create \
229
228
--parameters azuredeploy.parameters.json
230
229
```
231
230
232
-
For image export, when prompted, leave the `sourceName` blank. You can also leave `catalogDigest` and `forceUpdateTag` values blank.
231
+
> [!IMPORTANT]
232
+
> For artifact export, when prompted, leave the `sourceName` blank. You can also leave `catalogDigest` and `forceUpdateTag` values blank.
233
233
234
-
When deployment completes successfully, verify image export by viewing the exported blob in the *transfer* container of the source storage account.
234
+
When deployment completes successfully, verify artifact export by viewing the exported blob in the *transfer* container of the source storage account.
235
235
236
236
## Transfer blob (optional)
237
237
238
-
Use the AzCopy command to copy the blob from the source storage account to the target storage account. See [Copy blobs between storage accounts](/storage/common/storage-use-azcopy-blobs.md#copy-blobs-between-storage-accounts).
238
+
Use the AzCopy command to [transfer blob data](../storage/common/storage-use-azcopy-blobs.md#copy-blobs-between-storage-accounts) from the source storage account to the target storage account.
239
239
240
240
For example, the following [`azcopy sync`](/azure/storage/common/storage-ref-azcopy-sync) command synchronizes the *transfer* container from the source storage account with the *transfer* container in the target account. Authentication uses the export and import SAS tokens previously saved in environment variables:
241
241
@@ -250,7 +250,7 @@ azcopy sync \
250
250
251
251
### Create the ImportPipeline resource
252
252
253
-
Create an ImportPipeline resource in your target container registry using Azure Resource Manager template deployment. The ImportPipeline resource is provisioned with the target user-assigned identity you created previously. By default, the pipeline is triggered to import automatically when the target storage account has images.
253
+
Create an ImportPipeline resource in your target container registry using Azure Resource Manager template deployment. The ImportPipeline resource is provisioned with the target user-assigned identity you created previously. By default, the pipeline is triggered to import automatically when the target storage account has artifacts.
254
254
255
255
Copy ImportPipeline Resource Manager template files from [here](add link - TBD).
256
256
@@ -260,8 +260,8 @@ Parameter |Value |
260
260
|---------|---------|
261
261
|registryName | Name of your target container registry |
262
262
|importPipelineName | Name you choose for the import pipeline |
263
-
|sourceUri | URI of the container in your target storage account, which is the source for the import pipeline. Example: `https://targetstorage.blob.core.windows.net/transfer`|
264
-
|keyVaultUri | URI of the SAS token secret in the target key vault.Example: `https://targetvault.vault-int.azure-int.net/secrets/acrimportsas`|
263
+
|sourceUri | URI of the container in your target storage account (the source for the import pipeline).<br/>Example: `https://targetstorage.blob.core.windows.net/transfer`|
264
+
|keyVaultUri | URI of the SAS token secret in the target key vault.<br/>Example: `https://targetvault.vault-int.azure-int.net/secrets/acrimportsas`|
265
265
266
266
Run [az deployment group create][az-deployment-group-create] to create the resource.
267
267
@@ -273,22 +273,26 @@ az deployment group create \
When deployment completes successfully, verify image import by listing the repositories in the target container registry.
276
+
When deployment completes successfully, verify artifact import by listing the repositories in the target container registry. For example, run [az acr repository list][az-acr-repository-list]:
277
+
278
+
```azurecli
279
+
az acr repository list --name <target-registry-name>
280
+
```
277
281
278
282
### Run the ImportPipeline resource manually (optional)
279
283
280
-
You can also use a PipelineRun resource to trigger an ImportPipeline for image import to your target container registry.
284
+
You can also use a PipelineRun resource to trigger an ImportPipeline for artifact import to your target container registry.
281
285
282
286
Copy ExportPipeline Resource Manager template files from [here](add link - TBD).
283
287
284
288
Enter the following parameter values in the file `azuredeploy.parameters.json`:
285
289
286
290
|Parameter |Value |
287
291
|---------|---------|
288
-
|registryName | Name of your source container registry |
292
+
|registryName | Name of your target container registry |
289
293
|pipelineRunName | Name you choose for the run |
290
-
|pipelineResourceId | Resource ID of the import pipeline.Example: `/subscriptions/<subscriptionID>/resourceGroups/<resourceGroupName>/providers/Microsoft.ContainerRegistry/registries/<sourceRegistryName>/importPipelines/myImportPipeline`|
291
-
|sourceName | Name of the blob for exported artifacts in your storage account, such a*myblob*
294
+
|pipelineResourceId | Resource ID of the import pipeline.<br/>Example: `/subscriptions/<subscriptionID>/resourceGroups/<resourceGroupName>/providers/Microsoft.ContainerRegistry/registries/<sourceRegistryName>/importPipelines/myImportPipeline`|
295
+
|sourceName | Name of the existing blob for exported artifacts in your storage account, such as*myblob*
292
296
293
297
Run [az deployment group create][az-deployment-group-create] to run the resource.
294
298
@@ -299,9 +303,14 @@ az deployment group create \
299
303
--parameters azuredeploy.parameters.json
300
304
```
301
305
302
-
For image export, when prompted, leave the `targetName` blank. You can also leave `catalogDigest` and `forceUpdateTag` values blank.
306
+
> [!IMPORTANT]
307
+
> For artifact import to your registry, when prompted, leave the `targetName` blank. You can also leave `catalogDigest` and `forceUpdateTag` values blank.
308
+
309
+
When deployment completes successfully, verify artifact import by listing the repositories in the target container registry. For example, run [az acr repository list][az-acr-repository-list]:
303
310
304
-
When deployment completes successfully, verify image import by listing the repositories in the target container registry.
311
+
```azurecli
312
+
az acr repository list --name <target-registry-name>
313
+
```
305
314
306
315
## Manage pipeline resources
307
316
@@ -320,6 +329,7 @@ When deployment completes successfully, verify image import by listing the repos
0 commit comments