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
+93-31Lines changed: 93 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
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/03/2020
5
+
ms.date: 04/06/2020
6
6
ms.custom:
7
7
---
8
8
@@ -25,19 +25,16 @@ This feature is available in the **Premium** container registry service tier. Fo
25
25
26
26
## Prerequisites
27
27
28
-
***Container registries** - For this scenario 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. The steps in this article assume that the registries are in the same Active Directory tenant. If you need to create a registry, see [Quickstart: Create a private container registry using the Azure CLI](container-registry-get-started-cli.md).
29
-
***Storage accounts** - Create source and target storage accounts in the same Azure subscription or subscriptions as your source and target registries. 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*
28
+
***Container registries** - For this scenario you need an existing source registry with images you want 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-cli.md).
29
+
***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*
30
30
***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.
31
31
32
32
## Scenario overview
33
33
34
-
You create the following three resources for ACR Transfer. All are created using PUT operations. These resources operate on two storage accounts:
34
+
You create the following three resources for ACR Transfer. All are created using PUT operations. These resources operate on your *source* and *target* registries and storage accounts.
35
35
36
-
* A *source* storage account, where images from the source registry get exported
37
-
* A *target* storage account, from which images are imported to the target registry
38
-
39
-
***ExportPipeline** - Long-lasting resource that contains high-level information about the the *source* storage account. This information includes the storage blob container URI and the key vault secret URI of the storage SAS token.
40
-
***ImportPipeline** - Long-lasting resource that contains high-level information about the *target* storage account. This information includes the 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.
36
+
***ExportPipeline** - Long-lasting resource that contains high-level information about the *source* registry and storage account. This information includes the storage blob container URI and the key vault secret URI of the storage SAS token.
37
+
***ImportPipeline** - Long-lasting resource that contains high-level information about the *target* registry and storage account. This information includes the 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.
41
38
***PipelineRun** Resource used to invoke either an ExportPipeline or ImportPipeline resource.
42
39
43
40
You run the ExportPipeline manually by creating a PipelineRun resource. When you run the ExportPipeline, you specify the artifacts to be exported.
@@ -80,6 +77,12 @@ az keyvault secret set \
80
77
--vault-name sourcekeyvault
81
78
```
82
79
80
+
In the command output, take note of the secret's URI (`id`). You use the URIs in the export pipelines. Example:
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.
209
+
185
210
Copy ExportPipeline Resource Manager template files from [here](add link - TBD).
186
211
187
-
[Create a list of images to transfer - what is format?]
212
+
Enter the following parameter values in the file `azuredeploy.parameters.json`:
213
+
214
+
|Parameter |Value |
215
+
|---------|---------|
216
+
|registryName | Name of your source container registry |
217
+
|pipelineRunName | Name you choose for the run |
218
+
|pipelineResourceId | Resource ID of the export pipeline. Example: `/subscriptions/<subscriptionID>/resourceGroups/<resourceGroupName>/providers/Microsoft.ContainerRegistry/registries/<sourceRegistryName>/exportPipelines/myExportPipeline`|
219
+
|targetName | Name you choose for the blob for exported artifacts in your source storage account, such a *myblob*
220
+
|artifacts | Array of source images to transfer. Example: `[samples/hello-world:v1", "samples/nginx:v1"]`
188
221
189
222
Run [az deployment group create][az-deployment-group-create] to run the resource.
190
223
191
224
```azurecli
192
-
az group deployment create \
225
+
az deployment group create \
193
226
--resource-group myResourceGroup \
194
227
--template-file azuredeploy.json \
195
228
--parameters azuredeploy.parameters.json
196
229
```
197
230
231
+
For image export, when prompted, leave the `sourceName` blank. You can also leave `catalogDigest` and `forceUpdateTag` values blank.
232
+
233
+
When deployment completes successfully, verify image export by viewing the exported blob in the *transfer* container of the source storage account.
234
+
198
235
## Transfer blob (optional)
199
236
200
237
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).
201
238
202
-
[TODO: What does the AzCopy command look like? Is it the `azcopy sync` shown below?]
203
-
204
-
The following `azcopy sync` command ynchronizes the transfer containers in the source and target storage accounts:
239
+
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:
@@ -218,6 +253,15 @@ Create an ImportPipeline resource in your target container registry using Azure
218
253
219
254
Copy ImportPipeline Resource Manager template files from [here](add link - TBD).
220
255
256
+
Enter the following parameter values in the file `azuredeploy.parameters.json`:
257
+
258
+
Parameter |Value |
259
+
|---------|---------|
260
+
|registryName | Name of your target container registry |
261
+
|importPipelineName | Name you choose for the import pipeline |
262
+
|sourceUri | URI of the container in your target storage account, used as a source for the import pipeline. Example: `https://targetstorage.blob.core.windows.net/transfer`|
263
+
|keyVaultUri | URI of the SAS token secret in the target key vault. Example: `https://targetvault.vault-int.azure-int.net/secrets/acrimportsas`|
264
+
221
265
Run [az deployment group create][az-deployment-group-create] to create the resource.
222
266
223
267
```azurecli
@@ -228,22 +272,40 @@ az group deployment create \
When deployment completes successfully, verify image import by listing the repositories in the target container registry.
276
+
231
277
### Run the ImportPipeline resource manually (optional)
232
278
233
-
Copy ImportPipeline Resource Manager template files from [here](add link - TBD).
279
+
You can also use a PipelineRun resource to trigger an ImportPipeline for image import to your target container registry.
280
+
281
+
Copy ExportPipeline Resource Manager template files from [here](add link - TBD).
282
+
283
+
Enter the following parameter values in the file `azuredeploy.parameters.json`:
284
+
285
+
|Parameter |Value |
286
+
|---------|---------|
287
+
|registryName | Name of your source container registry |
288
+
|pipelineRunName | Name you choose for the run |
289
+
|pipelineResourceId | Resource ID of the import pipeline. Example: `/subscriptions/<subscriptionID>/resourceGroups/<resourceGroupName>/providers/Microsoft.ContainerRegistry/registries/<sourceRegistryName>/exportPipelines/myExportPipeline`|
290
+
|sourceName | Name of the blob for exported artifacts in your storage account, such a *myblob*
234
291
235
292
Run [az deployment group create][az-deployment-group-create] to run the resource.
236
-
293
+
237
294
```azurecli
238
-
az group deployment create \
239
-
--resource-group myResourceGroup \
240
-
--template-file azuredeploy.json \
241
-
--parameters azuredeploy.parameters.json
295
+
az deployment group create \
296
+
--resource-group myResourceGroup \
297
+
--template-file azuredeploy.json \
298
+
--parameters azuredeploy.parameters.json
242
299
```
243
300
244
-
## Verify image transfer
301
+
For image export, when prompted, leave the `targetName` blank. You can also leave `catalogDigest` and `forceUpdateTag` values blank.
302
+
303
+
When deployment completes successfully, verify image import by listing the repositories in the target container registry.
0 commit comments