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
+22-19Lines changed: 22 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,14 +28,17 @@ This feature is available in the **Premium** container registry service tier. Fo
28
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*.
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
+
> [!NOTE]
32
+
> The Azure CLI examples in this article use a `resourceGroup` environment variable for the resource group. Depending on your scenario, you may need separate resource groups for your source and target environments. All examples are formatted for the Bash shell.
33
+
31
34
## Scenario overview
32
35
33
36
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.
34
37
35
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.
36
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.
37
-
***PipelineRun** Resource used to invoke either an ExportPipeline or ImportPipeline resource.
38
-
You run the ExportPipeline manually by creating a PipelineRun resource. When you run the ExportPipeline, you specify the artifacts to be exported.
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.
39
42
40
43
If an import trigger is enabled, an ImportPipeline runs automatically. It can also be run manually using a PipelineRun.
41
44
@@ -75,7 +78,7 @@ az keyvault secret set \
75
78
--vault-name sourcekeyvault
76
79
```
77
80
78
-
In the command output, take note of the secret's URI (`id`). You use the URIs in the export pipelines. Example:
81
+
In the command output, take note of the secret's URI (`id`). You use the URI in the export pipelines. Example:
Create user-assigned managed identities for source and target key vaults by running the [az identity create][az-identity-create] command.
122
+
Create user-assigned managed identities to access source and target key vaults by running the [az identity create][az-identity-create] command.
120
123
121
124
```azurecli
122
-
# Managed identity for source vault
125
+
# Managed identity to access source vault
123
126
az identity create \
124
-
--resource-group myResourceGroup \
127
+
--resource-group $resourceGroup \
125
128
--name sourceId
126
129
127
-
# Managed identity for target vault
130
+
# Managed identity to access target vault
128
131
az identity create \
129
-
--resource-group myResourceGroup \
132
+
--resource-group $resourceGroup \
130
133
--name targetId
131
134
```
132
135
133
136
Set the following variables using the [az identity show][az-identity-show] command:
134
137
135
138
```azurecli
136
139
sourcePrincipalID=$(az identity show \
137
-
--resource-group myResourceGroup \
140
+
--resource-group $resourceGroup \
138
141
--name sourceId --query principalId --output tsv)
139
142
140
143
sourceResourceID=$(az identity show \
141
-
--resource-group myResourceGroup \
144
+
--resource-group $resourceGroup \
142
145
--name sourceId --query id --output tsv)
143
146
144
147
targetPrincipalID=$(az identity show \
145
-
--resource-group myResourceGroup \
148
+
--resource-group $resourceGroup \
146
149
--name targetId --query principalId --output tsv)
147
150
148
151
targetResourceID=$(az identity show \
149
-
--resource-group myResourceGroup \
152
+
--resource-group $resourceGroup \
150
153
--name targetId --query id --output tsv)
151
154
```
152
155
@@ -157,13 +160,13 @@ Run the [az keyvault set-policy][az-keyvault-set-policy] command to grant the so
157
160
```azurecli
158
161
# Source key vault
159
162
az keyvault set-policy --name sourcekeyvault \
160
-
--resource-group myResourceGroup \
163
+
--resource-group $resourceGroup \
161
164
--object-id $sourcePrincipalID \
162
165
--secret-permissions get
163
166
164
167
# Target key vault
165
168
az keyvault set-policy --name targetkeyvault \
166
-
--resource-group myResourceGroup \
169
+
--resource-group $resourceGroup \
167
170
--object-id $targetPrincipalID \
168
171
--secret-permissions get
169
172
```
@@ -183,13 +186,13 @@ Enter the following parameter values in the file `azuredeploy.parameters.json`:
183
186
|registryName | Name of your source container registry |
184
187
|exportPipelineName | Name you choose for the export pipeline |
185
188
|targetUri | URI of the container in your source storage account. Example: `https://sourcestorage.blob.core.windows.net/transfer`|
186
-
|keyVaultUri | URI of the SAS token secret in the source key vault. Example: `https://sourcevault.vault-int.azure-int.net/secrets/acrexportsas`|
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
190
188
191
Run [az deployment group create][az-deployment-group-create] to create the resource.
0 commit comments