Skip to content

Commit 8fdc414

Browse files
authored
Merge pull request #189261 from maud-lv/maud-aac-keys1
Add portal instructions to point in time snapshot
2 parents 6180ae4 + eb637a4 commit 8fdc414

7 files changed

+108
-18
lines changed
Lines changed: 108 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,146 @@
11
---
2-
title: Retrieve key-value pairs from a point-in-time
2+
title: Retrieve key-values from a point-in-time
33
titleSuffix: Azure App Configuration
44
description: Retrieve old key-value pairs using point-in-time snapshots in Azure App Configuration, which maintains a record of changes to key-values.
55
services: azure-app-configuration
6-
author: AlexandraKemperMS
7-
ms.author: alkemper
6+
author: maud-lv
7+
ms.author: malev
88
ms.service: azure-app-configuration
99
ms.topic: conceptual
10-
ms.date: 08/05/2020
10+
ms.date: 03/14/2022
1111
---
1212

1313
# Point-in-time snapshot
1414

15-
Azure App Configuration maintains a record of changes made to key-values. This record provides a timeline of key-value changes. You can reconstruct the history of any key-value and provide its past value at any moment within the key history period (7 days for Free tier stores, or 30 days for Standard tier stores). Using this feature, you can “time-travel” backward and retrieve an old key-value. For example, you can recover configuration settings used before the most recent deployment in order to roll back the application to the previous configuration.
15+
Azure App Configuration maintains a record of changes made to key-values. This record provides a timeline of key-value changes. You can reconstruct the history of any key and provide its past value at any moment within the key history period (7 days for Free tier stores, or 30 days for Standard tier stores). Using this feature, you can “time-travel” backward and retrieve an old key-value. For example, you can recover configuration settings used before the most recent deployment in order to roll back the application to the previous configuration.
1616

17-
## Key-value retrieval
17+
## Restore key-values
1818

19-
You can use Azure portal or CLI to retrieve past key-values. In Azure CLI, use `az appconfig revision list`, adding appropriate parameters to retrieve the required values. Specify the Azure App Configuration instance by providing either the store name (`--name <app-config-store-name>`) or by using a connection string (`--connection-string <your-connection-string>`). Restrict the output by specifying a specific point in time (`--datetime`) and by specifying the maximum number of items to return (`--top`).
19+
You can use the Azure portal or the Azure CLI to retrieve past key-values.
2020

21-
If you don't have Azure CLI installed locally, you can optionally use [Azure Cloud Shell](../cloud-shell/overview.md).
21+
### [Portal](#tab/azure-portal)
22+
23+
1. Sign in to the [Azure portal](https://portal.azure.com). Select **All resources**, and select the App Configuration store instance where your key-value are stored.
24+
25+
2. In the **Operations** menu, select **Restore**.
26+
27+
:::image type="content" source="media/restore-key-value-portal.png" alt-text="Screenshot of the Azure portal, selecting restore":::
28+
29+
3. Select **Date: Select date** to select a date and time you want to revert to.
30+
4. Click outside of the date and time fields or press **Tab** to validate your choice. You can now see which key values have changed between your selected date and time and the current time. This step helps you understand what keys and values you're preparing to revert to.
31+
32+
:::image type="content" source="media/restore-key-value-past-values.png" alt-text="Screenshot of the Azure portal with saved key-values":::
33+
34+
The portal displays a table of key-values. The first column includes symbols indicating what will happen if you restore the data for the chosen date and time:
35+
- The red minus sign (–) means that the key-value didn't exist at your selected date and time and will be deleted.
36+
- The green plus sign (+) means that the key-value existed at your selected date and time and doesn't exist now. If you revert to selected date and time it will be added back to your configuration.
37+
- The orange bullet sign (•) means that the key-value was modified since your selected date and time. The key will revert to the value it had at the selected date and time.
38+
39+
5. Select the checkbox in the row to select/deselect the key value to take action. When selected it will display the difference for the key value between the current and selected date and time.
40+
41+
:::image type="content" source="media/restore-key-value-compare.png" alt-text="Screenshot of the Azure portal with compared keys-values":::
42+
43+
In the above example, the preview shows the key TestApp:Settings:BackgroundColor, which currently has a value of #FFF. This value will be modified to #45288E if we go through with restoring the data.
44+
45+
You can select one or more checkboxes in the table to take action on the key-value of your choice. You can also use the select-all checkbox at the very top of the list to select/deselect all key-values.
46+
47+
6. Select **Restore** to restore the selected key-value(s) to the selected data and time.
48+
49+
:::image type="content" source="media/restore-key-value-confirm.png" alt-text="Screenshot of the Azure portal selecting Restore":::
50+
51+
### [Azure CLI](#tab/azure-cli)
52+
53+
Use the Azure CLI as explained below to retrieve and restore past key-values. If you don't have the Azure CLI installed locally, you can optionally use [Azure Cloud Shell](../cloud-shell/overview.md).
54+
55+
In the CLI, use `az appconfig revision list` to view changes or `az appconfig kv restore` to restore key-values, adding appropriate parameters. Specify the Azure App Configuration instance by providing either the store name (`--name <app-config-store-name>`) or by using a connection string (`--connection-string <your-connection-string>`). Restrict the output by specifying a specific point in time (`--datetime`), a label (`--label`) and the maximum number of items to return (`--top`).
56+
and by specifying the maximum number of items to return (`--top`).
2257

2358
Retrieve all recorded changes to your key-values.
2459

2560
```azurecli
26-
az appconfig revision list --name <your-app-config-store-name>.
61+
az appconfig revision list --name <your-app-config-store-name>
62+
```
63+
64+
Restore all key-values to a specific point in time.
65+
66+
```azurecli
67+
az appconfig kv restore --name <app-config-store-name> --datetime "2019-05-01T11:24:12Z"
68+
```
69+
70+
Restore for any label starting with v1. to a specific point in time.
71+
72+
```azurecli
73+
az appconfig kv restore --name <app-config-store-name> --label v1.* --datetime "2019-05-01T11:24:12Z"
74+
```
75+
76+
For more examples of CLI commands and optional parameters to restore key-value, go to the [Azure CLI documentation](/cli/azure/appconfig/kv).
77+
78+
You can also access the history of a specific key-value. This feature allows you to check the value of a specific key at a chosen point in time and to revert to a past value without updating any other key-value.
79+
80+
---
81+
82+
## Historical/Timeline view of key-value
83+
84+
> [!TIP]
85+
> This method is convenient if you have no more than a couple of changes to make, as Configuration explorer only lets you make changes key by key. If you need to restore multiple key-values at once, use the **Restore** menu instead.
86+
87+
### [Portal](#tab/azure-portal)
88+
89+
You can also access the revision history of a specific key-value in the portal.
90+
91+
1. In the **Operations** menu, select **Configuration explorer**.
92+
1. Select **More actions** for the key you want to explore, and then **History**
93+
94+
:::image type="content" source="media/explorer-key-history.png" alt-text="Screenshot of the Azure portal selecting key-value history":::
95+
96+
You can now see the revision history for the selected key and information about the changes.
97+
98+
1. Select **Restore** to restore the key and value to this point in time.
99+
100+
:::image type="content" source="media/explorer-key-day-restore.png" alt-text="Screenshot of the Azure portal viewing key-value data for a specific date":::
101+
102+
103+
### [Azure CLI](#tab/azure-cli)
104+
105+
Use the Azure CLI as explained below to retrieve and restore a single key-value. If you don't have the Azure CLI installed locally, you can optionally use [Azure Cloud Shell](../cloud-shell/overview.md).
106+
107+
In the CLI, use `az appconfig revision list` to view changes to a key-value or use `az appconfig kv restore` to restore a key-value, adding appropriate parameters. Specify the Azure App Configuration instance by providing either the store name (`--name <app-config-store-name>`) or by using a connection string (`--connection-string <your-connection-string>`). Restrict the output by specifying a specific key (`--key`). Optionally, specify a label (`--label`), a point in time (`--datetime`) and the maximum number of items to return (`--top`).
108+
109+
List revision history for key "color" with any labels.
110+
111+
```azurecli
112+
az appconfig revision list --name <app-config-store-name> --key color
27113
```
28114

29-
Retrieve all recorded changes for the key `environment` and the labels `test` and `prod`.
115+
List revision history of a specific key-value with a label.
30116

31117
```azurecli
32-
az appconfig revision list --name <your-app-config-store-name> --key environment --label test,prod
118+
az appconfig revision list --name <app-config-store-name> --key color --label test
33119
```
34120

35-
Retrieve all recorded changes in the hierarchical key space `environment:prod`.
121+
List revision history of a key-value with multiple labels.
36122

37123
```azurecli
38-
az appconfig revision list --name <your-app-config-store-name> --key environment:prod:*
124+
az appconfig revision list --name <app-config-store-name> --key color --label test,prod,\0
39125
```
40126

41127
Retrieve all recorded changes for the key `color` at a specific point-in-time.
42128

43129
```azurecli
44-
az appconfig revision list --connection-string <your-app-config-connection-string> --key color --datetime "2019-05-01T11:24:12Z"
130+
az appconfig revision list --name <app-config-store-name> --key color --datetime "2019-05-01T11:24:12Z"
45131
```
46132

47-
Retrieve the last 10 recorded changes to your key-values and return only the values for `key`, `label`, and `last_modified` time stamp.
133+
Retrieve the last 10 recorded changes for the key `color` at a specific point-in-time.
48134

49-
```azurecli-interactive
50-
az appconfig revision list --name <your-app-config-store-name> --top 10 --fields key label last_modified
135+
```azurecli
136+
az appconfig revision list --name <app-config-store-name> --key color --top 10 --datetime "2019-05-01T11:24:12Z"
51137
```
52138

139+
For more examples and optional parameters, go to the [Azure CLI documentation](/cli/azure/appconfig/revision).
140+
141+
---
142+
53143
## Next steps
54144

55145
> [!div class="nextstepaction"]
56-
> [Create an ASP.NET Core web app](./quickstart-aspnet-core-app.md)
146+
> [Create an ASP.NET Core web app](./quickstart-aspnet-core-app.md)
45.6 KB
Loading
185 KB
Loading
95.5 KB
Loading
61.3 KB
Loading
54.9 KB
Loading
117 KB
Loading

0 commit comments

Comments
 (0)