Skip to content

Commit 448218a

Browse files
committed
edits
1 parent 4a72319 commit 448218a

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

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

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@ This feature is available in the **Premium** container registry service tier. Fo
2828
* **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*.
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

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+
3134
## Scenario overview
3235

3336
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.
3437

3538
* **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.
3639
* **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.
3942

4043
If an import trigger is enabled, an ImportPipeline runs automatically. It can also be run manually using a PipelineRun.
4144

@@ -75,7 +78,7 @@ az keyvault secret set \
7578
--vault-name sourcekeyvault
7679
```
7780

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

8083
```azurecli
8184
https://sourcekeyvault.vault-int.azure-int.net/secrets/acrexportsas/xxxxxxxxxxxxxxx
@@ -116,37 +119,37 @@ https://targetkeyvault.vault-int.azure-int.net/secrets/acrimportsas/xxxxxxxxxxxx
116119

117120
## Create identities
118121

119-
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.
120123

121124
```azurecli
122-
# Managed identity for source vault
125+
# Managed identity to access source vault
123126
az identity create \
124-
--resource-group myResourceGroup \
127+
--resource-group $resourceGroup \
125128
--name sourceId
126129
127-
# Managed identity for target vault
130+
# Managed identity to access target vault
128131
az identity create \
129-
--resource-group myResourceGroup \
132+
--resource-group $resourceGroup \
130133
--name targetId
131134
```
132135

133136
Set the following variables using the [az identity show][az-identity-show] command:
134137

135138
```azurecli
136139
sourcePrincipalID=$(az identity show \
137-
--resource-group myResourceGroup \
140+
--resource-group $resourceGroup \
138141
--name sourceId --query principalId --output tsv)
139142
140143
sourceResourceID=$(az identity show \
141-
--resource-group myResourceGroup \
144+
--resource-group $resourceGroup \
142145
--name sourceId --query id --output tsv)
143146
144147
targetPrincipalID=$(az identity show \
145-
--resource-group myResourceGroup \
148+
--resource-group $resourceGroup \
146149
--name targetId --query principalId --output tsv)
147150
148151
targetResourceID=$(az identity show \
149-
--resource-group myResourceGroup \
152+
--resource-group $resourceGroup \
150153
--name targetId --query id --output tsv)
151154
```
152155

@@ -157,13 +160,13 @@ Run the [az keyvault set-policy][az-keyvault-set-policy] command to grant the so
157160
```azurecli
158161
# Source key vault
159162
az keyvault set-policy --name sourcekeyvault \
160-
--resource-group myResourceGroup \
163+
--resource-group $resourceGroup \
161164
--object-id $sourcePrincipalID \
162165
--secret-permissions get
163166
164167
# Target key vault
165168
az keyvault set-policy --name targetkeyvault \
166-
--resource-group myResourceGroup \
169+
--resource-group $resourceGroup \
167170
--object-id $targetPrincipalID \
168171
--secret-permissions get
169172
```
@@ -183,13 +186,13 @@ Enter the following parameter values in the file `azuredeploy.parameters.json`:
183186
|registryName | Name of your source container registry |
184187
|exportPipelineName | Name you choose for the export pipeline |
185188
|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` |
187190

188191
Run [az deployment group create][az-deployment-group-create] to create the resource.
189192

190193
```azurecli
191194
az deployment group create \
192-
--resource-group myResourceGroup \
195+
--resource-group $resourceGroup \
193196
--template-file azuredeploy.json \
194197
--parameters azuredeploy.parameters.json \
195198
--parameters userAssignedIdentity=$sourceResourceID
@@ -221,7 +224,7 @@ Run [az deployment group create][az-deployment-group-create] to run the resource
221224

222225
```azurecli
223226
az deployment group create \
224-
--resource-group myResourceGroup \
227+
--resource-group $resourceGroup \
225228
--template-file azuredeploy.json \
226229
--parameters azuredeploy.parameters.json
227230
```
@@ -264,7 +267,7 @@ Run [az deployment group create][az-deployment-group-create] to create the resou
264267

265268
```azurecli
266269
az deployment group create \
267-
--resource-group myResourceGroup \
270+
--resource-group $resourceGroup \
268271
--template-file azuredeploy.json \
269272
--parameters azuredeploy.parameters.json \
270273
--parameters userAssignedIdentity=$targetResourceID
@@ -291,7 +294,7 @@ Run [az deployment group create][az-deployment-group-create] to run the resource
291294

292295
```azurecli
293296
az deployment group create \
294-
--resource-group myResourceGroup \
297+
--resource-group $resourceGroup \
295298
--template-file azuredeploy.json \
296299
--parameters azuredeploy.parameters.json
297300
```

0 commit comments

Comments
 (0)