Skip to content

Commit 877aa04

Browse files
indention
1 parent 3068227 commit 877aa04

File tree

1 file changed

+64
-27
lines changed

1 file changed

+64
-27
lines changed

articles/container-registry/container-registry-soft-delete-policy.md

Lines changed: 64 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ ms.author: tejaswikolli
1010

1111
Azure Container Registry (ACR) allows you to enable the *soft delete policy* to recover any accidentally deleted artifacts for a set retention period.
1212

13+
1314
:::image type="content" source="./media/container-registry-delete/02-soft-delete.png" alt-text="Diagram of soft delete artifacts lifecycle.":::
1415

16+
1517
This feature is available in all the service tiers (also known as SKUs). For information about registry service tiers, see [Azure Container Registry service tiers](container-registry-skus.md).
1618

1719
> [!NOTE]
@@ -55,71 +57,71 @@ For example, after five days of soft deleting the artifact, if the user changes
5557

5658
1. Update soft delete policy for a given `MyRegistry` ACR with a retention period set between 1 to 90 days.
5759

58-
```azurecli-interactive
59-
az acr config soft-delete update -r MyRegistry --days 7 --status <enabled/disabled>
60-
```
60+
```azurecli-interactive
61+
az acr config soft-delete update -r MyRegistry --days 7 --status <enabled/disabled>
62+
```
6163
6264
2. Show configured soft delete policy for a given `MyRegistry` ACR.
6365
64-
```azurecli-interactive
65-
az acr config soft-delete show -r MyRegistry
66-
```
66+
```azurecli-interactive
67+
az acr config soft-delete show -r MyRegistry
68+
```
6769
6870
### List the soft-delete artifacts- CLI
6971
7072
The `az acr repository list-deleted` commands enable fetching and listing of the soft deleted repositories. For more information use `--help`.
7173
7274
1. List the soft deleted repositories in a given `MyRegistry` ACR.
7375
74-
```azurecli-interactive
75-
az acr repository list-deleted -n MyRegistry
76-
```
76+
```azurecli-interactive
77+
az acr repository list-deleted -n MyRegistry
78+
```
7779
7880
The `az acr manifest list-deleted` commands enable fetching and listing of the soft delete manifests.
7981
8082
2. List the soft deleted manifests of a `hello-world` repository in a given `MyRegistry` ACR.
8183
82-
```azurecli-interactive
83-
az acr manifest list-deleted -r MyRegistry -n hello-world
84-
```
84+
```azurecli-interactive
85+
az acr manifest list-deleted -r MyRegistry -n hello-world
86+
```
8587
8688
The `az acr manifest list-deleted-tags` commands enable fetching and listing of the soft delete tags.
8789
8890
3. List the soft delete tags of a `hello-world` repository in a given `MyRegistry` ACR.
8991
90-
```azurecli-interactive
91-
az acr manifest list-deleted-tags -r MyRegistry -n hello-world
92-
```
92+
```azurecli-interactive
93+
az acr manifest list-deleted-tags -r MyRegistry -n hello-world
94+
```
9395
9496
4. Filter the soft delete tags of a `hello-world` repository to match tag `latest` in a given `MyRegistry` ACR.
9597
96-
```azurecli-interactive
97-
az acr manifest list-deleted-tags -r MyRegistry -n hello-world:latest
98-
```
98+
```azurecli-interactive
99+
az acr manifest list-deleted-tags -r MyRegistry -n hello-world:latest
100+
```
99101
100102
### Restore the soft delete artifacts - CLI
101103
102104
The `az acr manifest restore` commands restore a single image by tag and digest.
103105
104106
1. Restore the image of a `hello-world` repository by tag `latest`and digest `sha256:abc123` in a given `MyRegistry` ACR.
105107
106-
```azurecli-interactive
107-
az acr manifest restore -r MyRegistry -n hello-world:latest -d sha256:abc123
108-
```
108+
```azurecli-interactive
109+
az acr manifest restore -r MyRegistry -n hello-world:latest -d sha256:abc123
110+
```
109111
110112
2. Restore the most recently deleted manifest of a `hello-world` repository by tag `latest` in a given `MyRegistry` ACR.
111113
112-
```azurecli-interactive
113-
az acr manifest restore -r MyRegistry -n hello-world:latest
114-
```
114+
```azurecli-interactive
115+
az acr manifest restore -r MyRegistry -n hello-world:latest
116+
```
115117
116118
Force restore will overwrite the existing tag with the same name in the repository. If the soft delete policy is enabled during force restore. The overwritten tag will be soft deleted. You can force restore with specific arguments `--force, -f`.
117119
118120
3. Force restore the image of a `hello-world` repository by tag `latest`and digest `sha256:abc123` in a given `MyRegistry` ACR.
119121
120-
```azurecli-interactive
121-
az acr manifest restore -r MyRegistry -n hello-world:latest -d sha256:abc123 -f
122-
```
122+
```azurecli-interactive
123+
az acr manifest restore -r MyRegistry -n hello-world:latest -d sha256:abc123 -f
124+
```
123125
124126
> [!IMPORTANT]
125127
>* Restoring a [manifest list](push-multi-architecture-images.md#manifest-list) won't recursively restore any underlying soft deleted manifests.
@@ -133,14 +135,22 @@ You can also enable a registry's soft delete policy in the [Azure portal](https:
133135
1. In the **Overview tab**, verify the status of the **Soft Delete** (Preview).
134136
1. If the **Status** is **Disabled**, Select **Update**.
135137
138+
139+
136140
:::image type="content" source="./media/container-registry-soft-delete/01-soft-delete-disable.png" alt-text="Screenshot to view the soft delete policy.":::
137141
142+
143+
138144
1. Select the checkbox to **Enable Soft Delete**.
139145
1. Select the number of days between `0` and `90` days to retain the soft deleted artifacts.
140146
1. Select **Save** to save your changes.
141147
148+
149+
142150
:::image type="content" source="./media/container-registry-soft-delete/02-soft-delete-policy.png" alt-text="Screenshot to enable soft delete policy.":::
143151
152+
153+
144154
### Restore the soft deleted artifacts - Portal
145155
146156
1. Navigate to your Azure Container Registry.
@@ -151,44 +161,71 @@ You can also enable a registry's soft delete policy in the [Azure portal](https:
151161
> [!NOTE]
152162
> Once you enable the soft delete policy and perform actions such as untag a manifest or delete an artifact, You will be able to find these tags and artifacts in the Managed delete artifacts before the number of retention days expire.
153163
164+
165+
154166
:::image type="content" source="./media/container-registry-soft-delete/03-soft-delete-manage-deleted-artifacts.png" alt-text="Screenshot of manage deleted artifacts.":::
155167
168+
169+
156170
1. Filter the deleted artifact you have to restore
157171
1. Select the artifact, and Click on the **Restore** in the right column.
158172
1. A **Restore Artifact** window pops up.
159173
174+
175+
160176
:::image type="content" source="./media/container-registry-soft-delete/04-managed-deleted-artifacts.png" alt-text="Screenshot to restore soft delete artifacts.":::
161177
178+
179+
162180
1. Select the tag to restore, here you have an option to choose, and recover any additional tags.
163181
1. Click on **Restore**.
164182
183+
184+
165185
:::image type="content" source="./media/container-registry-soft-delete/05-restore-artifact.png" alt-text="Screenshot of restore window.":::
166186
187+
188+
167189
### Restore from soft deleted repositories - Portal
168190
169191
1. Navigate to your Azure Container Registry.
170192
1. In the **Menu** section, Select **Services**,
171193
1. In the **Services** tab, Select **Repositories**.
172194
1. In the **Repositories** tab, Click on **Manage Deleted Repositories**.
173195
196+
197+
174198
:::image type="content" source="./media/container-registry-soft-delete/06-manage-delete-repositories.png" alt-text="Screenshot of manage delete repositories.":::
175199
200+
201+
176202
1. Filter the deleted repository in the **Soft Deleted Repositories**(Preview).
177203
204+
205+
178206
:::image type="content" source="./media/container-registry-soft-delete/07-soft-delete-repositories.png" alt-text="Screenshot of soft delete repositories.":::
179207
208+
209+
180210
1. Select the deleted repository, filter the deleted artifact from on the **Manage deleted artifacts**.
181211
1. Select the artifact, and Click on the **Restore** in the right column.
182212
1. A **Restore Artifact** window pops up.
183213
214+
215+
184216
:::image type="content" source="./media/container-registry-soft-delete/08-soft-delete-repository-artifacts.png" alt-text="Screenshot to restore soft delete repositories.":::
185217
218+
219+
186220
1. Select the tag to restore, here you have an option to choose, and recover any additional tags.
187221
1. Click on **Restore**.
188222
223+
224+
189225
:::image type="content" source="./media/container-registry-soft-delete/09-soft-delete-restore.png" alt-text="Screenshot of restore window for soft delete repositories.":::
190226
191227
228+
192229
> [!IMPORTANT]
193230
>* Importing a soft deleted image at both source and target resources is blocked.
194231
>* Pushing an image to the soft deleted repository will restore the soft deleted repository.

0 commit comments

Comments
 (0)