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-soft-delete-policy.md
+64-27Lines changed: 64 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,10 @@ ms.author: tejaswikolli
10
10
11
11
Azure Container Registry (ACR) allows you to enable the *soft delete policy* to recover any accidentally deleted artifacts for a set retention period.
12
12
13
+
13
14
:::image type="content" source="./media/container-registry-delete/02-soft-delete.png" alt-text="Diagram of soft delete artifacts lifecycle.":::
14
15
16
+
15
17
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).
16
18
17
19
> [!NOTE]
@@ -55,71 +57,71 @@ For example, after five days of soft deleting the artifact, if the user changes
55
57
56
58
1. Update soft delete policy for a given `MyRegistry` ACR with a retention period set between 1 to 90 days.
2. Show configured soft delete policy for a given `MyRegistry` ACR.
63
65
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
+
```
67
69
68
70
### List the soft-delete artifacts- CLI
69
71
70
72
The `az acr repository list-deleted` commands enable fetching and listing of the soft deleted repositories. For more information use `--help`.
71
73
72
74
1. List the soft deleted repositories in a given `MyRegistry` ACR.
73
75
74
-
```azurecli-interactive
75
-
az acr repository list-deleted -n MyRegistry
76
-
```
76
+
```azurecli-interactive
77
+
az acr repository list-deleted -n MyRegistry
78
+
```
77
79
78
80
The `az acr manifest list-deleted` commands enable fetching and listing of the soft delete manifests.
79
81
80
82
2. List the soft deleted manifests of a `hello-world` repository in a given `MyRegistry` ACR.
81
83
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
+
```
85
87
86
88
The `az acr manifest list-deleted-tags` commands enable fetching and listing of the soft delete tags.
87
89
88
90
3. List the soft delete tags of a `hello-world` repository in a given `MyRegistry` ACR.
89
91
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
+
```
93
95
94
96
4. Filter the soft delete tags of a `hello-world` repository to match tag `latest` in a given `MyRegistry` ACR.
95
97
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
+
```
99
101
100
102
### Restore the soft delete artifacts - CLI
101
103
102
104
The `az acr manifest restore` commands restore a single image by tag and digest.
103
105
104
106
1. Restore the image of a `hello-world` repository by tag `latest`and digest `sha256:abc123` in a given `MyRegistry` ACR.
105
107
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
+
```
109
111
110
112
2. Restore the most recently deleted manifest of a `hello-world` repository by tag `latest` in a given `MyRegistry` ACR.
111
113
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
+
```
115
117
116
118
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`.
117
119
118
120
3. Force restore the image of a `hello-world` repository by tag `latest`and digest `sha256:abc123` in a given `MyRegistry` ACR.
>* 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:
133
135
1. In the **Overview tab**, verify the status of the **Soft Delete** (Preview).
134
136
1. If the **Status** is **Disabled**, Select **Update**.
135
137
138
+
139
+
136
140
:::image type="content" source="./media/container-registry-soft-delete/01-soft-delete-disable.png" alt-text="Screenshot to view the soft delete policy.":::
137
141
142
+
143
+
138
144
1. Select the checkbox to **Enable Soft Delete**.
139
145
1. Select the number of days between `0` and `90` days to retain the soft deleted artifacts.
140
146
1. Select **Save** to save your changes.
141
147
148
+
149
+
142
150
:::image type="content" source="./media/container-registry-soft-delete/02-soft-delete-policy.png" alt-text="Screenshot to enable soft delete policy.":::
143
151
152
+
153
+
144
154
### Restore the soft deleted artifacts - Portal
145
155
146
156
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:
151
161
> [!NOTE]
152
162
> 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.
153
163
164
+
165
+
154
166
:::image type="content" source="./media/container-registry-soft-delete/03-soft-delete-manage-deleted-artifacts.png" alt-text="Screenshot of manage deleted artifacts.":::
155
167
168
+
169
+
156
170
1. Filter the deleted artifact you have to restore
157
171
1. Select the artifact, and Click on the **Restore** in the right column.
158
172
1. A **Restore Artifact** window pops up.
159
173
174
+
175
+
160
176
:::image type="content" source="./media/container-registry-soft-delete/04-managed-deleted-artifacts.png" alt-text="Screenshot to restore soft delete artifacts.":::
161
177
178
+
179
+
162
180
1. Select the tag to restore, here you have an option to choose, and recover any additional tags.
163
181
1. Click on **Restore**.
164
182
183
+
184
+
165
185
:::image type="content" source="./media/container-registry-soft-delete/05-restore-artifact.png" alt-text="Screenshot of restore window.":::
166
186
187
+
188
+
167
189
### Restore from soft deleted repositories - Portal
168
190
169
191
1. Navigate to your Azure Container Registry.
170
192
1. In the **Menu** section, Select **Services**,
171
193
1. In the **Services** tab, Select **Repositories**.
172
194
1. In the **Repositories** tab, Click on **Manage Deleted Repositories**.
173
195
196
+
197
+
174
198
:::image type="content" source="./media/container-registry-soft-delete/06-manage-delete-repositories.png" alt-text="Screenshot of manage delete repositories.":::
175
199
200
+
201
+
176
202
1. Filter the deleted repository in the **Soft Deleted Repositories**(Preview).
177
203
204
+
205
+
178
206
:::image type="content" source="./media/container-registry-soft-delete/07-soft-delete-repositories.png" alt-text="Screenshot of soft delete repositories.":::
179
207
208
+
209
+
180
210
1. Select the deleted repository, filter the deleted artifact from on the **Manage deleted artifacts**.
181
211
1. Select the artifact, and Click on the **Restore** in the right column.
182
212
1. A **Restore Artifact** window pops up.
183
213
214
+
215
+
184
216
:::image type="content" source="./media/container-registry-soft-delete/08-soft-delete-repository-artifacts.png" alt-text="Screenshot to restore soft delete repositories.":::
185
217
218
+
219
+
186
220
1. Select the tag to restore, here you have an option to choose, and recover any additional tags.
187
221
1. Click on **Restore**.
188
222
223
+
224
+
189
225
:::image type="content" source="./media/container-registry-soft-delete/09-soft-delete-restore.png" alt-text="Screenshot of restore window for soft delete repositories.":::
190
226
191
227
228
+
192
229
> [!IMPORTANT]
193
230
>* Importing a soft deleted image at both source and target resources is blocked.
194
231
>* Pushing an image to the soft deleted repository will restore the soft deleted repository.
0 commit comments