Skip to content

Commit 5df577d

Browse files
committed
work in progress
1 parent 4bc4b1c commit 5df577d

File tree

1 file changed

+31
-34
lines changed

1 file changed

+31
-34
lines changed

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

Lines changed: 31 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,59 @@
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: 03/31/2020
5+
ms.date: 04/03/2020
66
ms.custom:
77
---
88

99
# Transfer images to another registry
1010

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 in different Active Directory tenants or Azure clouds.
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.
1212

1313
To transfer images, you create a transfer *pipeline*:
1414

1515
* Create source and target storage resources, and store storage access secrets in Azure key vaults
16-
* Create and run a registry resource to export images to the source storage account
16+
* Create and run a resource that exports images to the source storage account
1717
* Copy images from the source storage account to the target storage account
18-
* Create a registry resource to import images to the target registry. You can set up the import pipeline to trigger whenever images are in the source storage account
18+
* Create a resource that imports images to the target registry. You can set up the import pipeline to trigger whenever images are in the source storage account
1919

20-
Transferring registry images offers a more general, scalable alternative to [importing images](container-registry-import-images.md) from one container registry to another.
20+
Transferring registry images is a more general, scalable alternative to [importing images](container-registry-import-images.md) from one container registry to another.
2121

2222
In this article, you use the Azure CLI and Azure Resource Manager templates to create the resources and transfer pipeline. If you'd like to use the Azure CLI locally, you must have Azure CLI version **XXX** or later installed and logged in with [az login][az-login]. Run `az --version` to find the version. If you need to install or upgrade the CLI, see [Install Azure CLI][azure-cli].
2323

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

26-
2726
## Prerequisites
2827

29-
* **Container registries** - For this scenario you need an existing source registry with images to transfer, and a target registry. The source and target registry can be in the same or a different Azure subscription. For the steps in article, the registries must be 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).
30-
* **Storage accounts** - Create source and target storage accounts in the same Azure 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.
31-
32-
[TODO: Needed to create source and target blob containers??]
33-
34-
* **Key vaults** Create key vaults to store secrets in the same Azure 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.
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*
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.
3531

3632
## Scenario overview
3733

38-
You create the following three resources for ACR Transfer. All are created using PUT operations.
34+
You create the following three resources for ACR Transfer. All are created using PUT operations. These resources operate on two storage accounts:
3935

40-
* **ExportPipeline** - Long-lasting resource that contains high level target information, such as storage blob container URI and the key vault secret URI of the target storage SAS token.
41-
* **ImportPipeline** - Long lasting resource that contains high level source info, such as storage blob container URI and the KV secret URI of the source storage SAS token. Source trigger is enabled by default so the pipeline will run automatically when artifacts land in the source storage container.
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.
4241
* **PipelineRun** Resource used to invoke either an ExportPipeline or ImportPipeline resource.
4342

44-
An ExportPipeline must be run manually by creating a PipelineRun resource. When you run the ExportPipeline, you specify the artifacts to be exported.
43+
You run the ExportPipeline manually by creating a PipelineRun resource. When you run the ExportPipeline, you specify the artifacts to be exported.
4544

46-
If a source trigger is enabled, an ImportPipeline runs automatically. It can also be run manually using a PipelineRun.
45+
If an import trigger is enabled, an ImportPipeline runs automatically. It can also be run manually using a PipelineRun.
4746

48-
### Alternate scenarios
49-
* The ImportPipeline and ExportPipeline may be located in different tenants. In this case, you need separate managed identities and key vaults for the export and import resources.
47+
### Things to know
48+
* 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.
5049
* ExportPipelines and ImportPipelines also support system-assigned identities. In this case, assign the identity permissions to your key vault after the export resource is created and before running.
5150

5251
## Create and store SAS tokens
5352

54-
Transfer uses shared access signature (SAS) tokens to export to and import from storage accounts. The properties required to create SAS tokens are detailed below.
55-
56-
[TODO: Create containers, generate tokens at container level?]
53+
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.
5754

5855
### SAS token for export
5956

60-
Generate a SAS token for export in the source storage account.
57+
Generate a SAS token for export to the source storage account.
6158

6259
SAS properties:
6360
* **Allowed services** - Blob
@@ -85,7 +82,7 @@ az keyvault secret set \
8582

8683
### SAS token for import
8784

88-
Generate a SAS token for import in the target storage account.
85+
Generate a SAS token for import from the target storage account.
8986

9087
SAS properties:
9188
* **Allowed services** - Blob
@@ -101,7 +98,7 @@ Copy the generated SAS token and use it to set the IMPORT_SAS environment variab
10198
```console
10299
IMPORT_SAS='?sv=2019-02-02&...'
103100

104-
Store the SAS token in your target Azure key vault using [az keyvault secret set][az-keyvault-secret-set]:
101+
Store the SAS token in your target Azure key vault using [az keyvault secret set][az-keyvault-secret-set] command:
105102

106103
```azurecli
107104
az keyvault secret set \
@@ -149,7 +146,7 @@ targetResourceID=$(az identity show \
149146

150147
## Grant each identity access to key vault
151148

152-
Run the [az keyvault set-policy][az-keyvault-set-policy] command to grant each identity access to the respective key vault:
149+
Run the [az keyvault set-policy][az-keyvault-set-policy] command to grant the source and target identities access to their respective key vaults:
153150

154151
```azurecli
155152
# Source key vault
@@ -169,7 +166,7 @@ az keyvault set-policy --name targetkeyvault \
169166

170167
### Create the ExportPipeline resource
171168

172-
Create an ExportPipeline resource in your source container registry using Azure Resource Manager template deployment. The ExportPipeline resource is provisioned with the user-assigned identity you created previously.
169+
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.
173170

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

@@ -180,7 +177,7 @@ az deployment group create \
180177
--resource-group myResourceGroup \
181178
--template-file azuredeploy.json \
182179
--parameters azuredeploy.parameters.json \
183-
--parameters userAssignedIdentity=$resourceID
180+
--parameters userAssignedIdentity=$sourceResourceID
184181
```
185182

186183
### Run the ExportPipeline resource
@@ -200,24 +197,24 @@ az group deployment create \
200197

201198
## Transfer blob (optional)
202199

203-
Copy the blob to the target storage account using the AzCopy command. See [Copy blobs between storage accounts](/storage/common/storage-use-azcopy-blobs.md#copy-blobs-between-storage-accounts).
200+
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).
204201

205202
[TODO: What does the AzCopy command look like? Is it the `azcopy sync` shown below?]
206203

207-
Synchronize the source and target storage containers:
204+
The following `azcopy sync` command ynchronizes the transfer containers in the source and target storage accounts:
208205

209206
```console
210207
azcopy sync \
211-
'https://<source-storage-account-name>.blob.core.windows.net/<container-name>' \
212-
'https://<destination-storage-account-name>.blob.core.windows.net/<container-name>' \
208+
'https://<source-storage-account-name>.blob.core.windows.net/transfer' \
209+
'https://<destination-storage-account-name>.blob.core.windows.net/transfer' \
213210
--recursive
214211
```
215212

216213
## Import
217214

218215
### Create the ImportPipeline resource
219216

220-
Create an ImportPipeline resource in your target container registry using Azure Resource Manager template deployment. The ImportPipeline resource is provisioned with the user-assigned identity you created previously.
217+
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.
221218

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

@@ -228,7 +225,7 @@ az group deployment create \
228225
--resource-group myResourceGroup \
229226
--template-file azuredeploy.json \
230227
--parameters azuredeploy.parameters.json \
231-
--parameters userAssignedIdentity=$resourceID
228+
--parameters userAssignedIdentity=$targetResourceID
232229
```
233230

234231
### Run the ImportPipeline resource manually (optional)

0 commit comments

Comments
 (0)