Skip to content

Commit cd2a0af

Browse files
committed
edits
1 parent 448218a commit cd2a0af

File tree

1 file changed

+45
-35
lines changed

1 file changed

+45
-35
lines changed

articles/container-registry/container-registry-transfer-images.md

Lines changed: 45 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22
title: Transfer images
33
description: Transfer images in bulk from one container registry to another registry by creating a transfer pipeline using Azure storage accounts
44
ms.topic: article
5-
ms.date: 04/06/2020
5+
ms.date: 04/07/2020
66
ms.custom:
77
---
88

9-
# Transfer images to another registry
9+
# Transfer artifacts to another registry
1010

1111
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.
1212

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:
1414

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
1616
* 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.
1818

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

2121
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].
2222

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

2525
## Prerequisites
2626

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*.
2929
* **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.
3030

3131
> [!NOTE]
@@ -38,21 +38,20 @@ You create the following three resources for ACR Transfer. All are created using
3838
* **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.
3939
* **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.
4040
* **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.
4443

4544
### Things to know
4645
* 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.
4746
* 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.
4847

4948
## Create and store SAS tokens
5049

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

5352
### SAS token for export
5453

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

5756
SAS properties:
5857
* **Allowed services** - Blob
@@ -86,7 +85,7 @@ https://sourcekeyvault.vault-int.azure-int.net/secrets/acrexportsas/xxxxxxxxxxxx
8685

8786
### SAS token for import
8887

89-
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.
9089

9190
SAS properties:
9291
* **Allowed services** - Blob
@@ -175,7 +174,7 @@ az keyvault set-policy --name targetkeyvault \
175174

176175
### Create the ExportPipeline resource
177176

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

180179
Copy ExportPipeline Resource Manager template files from [here](add link - TBD).
181180

@@ -185,8 +184,8 @@ Enter the following parameter values in the file `azuredeploy.parameters.json`:
185184
|---------|---------|
186185
|registryName | Name of your source container registry |
187186
|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` |
190189

191190
Run [az deployment group create][az-deployment-group-create] to create the resource.
192191

@@ -206,7 +205,7 @@ Take note of the resource ID (`id`) of the pipeline, which is used in later step
206205

207206
### Run the ExportPipeline resource
208207

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

211210
Copy ExportPipeline Resource Manager template files from [here](add link - TBD).
212211

@@ -216,11 +215,11 @@ Enter the following parameter values in the file `azuredeploy.parameters.json`:
216215
|---------|---------|
217216
|registryName | Name of your source container registry |
218217
|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"]`
222221

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

225224
```azurecli
226225
az deployment group create \
@@ -229,13 +228,14 @@ az deployment group create \
229228
--parameters azuredeploy.parameters.json
230229
```
231230

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.
233233
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.
235235

236236
## Transfer blob (optional)
237237

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

240240
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:
241241

@@ -250,7 +250,7 @@ azcopy sync \
250250

251251
### Create the ImportPipeline resource
252252

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

255255
Copy ImportPipeline Resource Manager template files from [here](add link - TBD).
256256

@@ -260,8 +260,8 @@ Parameter |Value |
260260
|---------|---------|
261261
|registryName | Name of your target container registry |
262262
|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` |
265265

266266
Run [az deployment group create][az-deployment-group-create] to create the resource.
267267

@@ -273,22 +273,26 @@ az deployment group create \
273273
--parameters userAssignedIdentity=$targetResourceID
274274
```
275275

276-
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+
```
277281

278282
### Run the ImportPipeline resource manually (optional)
279283

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

282286
Copy ExportPipeline Resource Manager template files from [here](add link - TBD).
283287

284288
Enter the following parameter values in the file `azuredeploy.parameters.json`:
285289

286290
|Parameter |Value |
287291
|---------|---------|
288-
|registryName | Name of your source container registry |
292+
|registryName | Name of your target container registry |
289293
|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*
292296

293297
Run [az deployment group create][az-deployment-group-create] to run the resource.
294298

@@ -299,9 +303,14 @@ az deployment group create \
299303
--parameters azuredeploy.parameters.json
300304
```
301305

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]:
303310

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+
```
305314

306315
## Manage pipeline resources
307316

@@ -320,6 +329,7 @@ When deployment completes successfully, verify image import by listing the repos
320329
[az-keyvault-set-policy]: /cli/azure/keyvault#az-keyvault-set-policy
321330
[az-storage-account-generate-sas]: /cli/azure/storage/account#az-storage-account-generate-sas
322331
[az-deployment-group-create]: /cli/azure/deployment/group#az-deployment-group-create
332+
[az-acr-repository-list]: /cli/azure/acr/repository#az-acr-repository-list
323333

324334

325335

0 commit comments

Comments
 (0)