|
1 | 1 | ---
|
2 |
| -title: Azure App Configuration point-in-time snapshot |
3 |
| -description: An overview of how point-in-time snapshot works in Azure App Configuration |
| 2 | +title: Retrieve key-value pairs from a point-in-time |
| 3 | +titleSuffix: Azure App Configuration |
| 4 | +description: Retrieve old key-value pairs using point-in-time snapshots in Azure App Configuration |
4 | 5 | services: azure-app-configuration
|
5 | 6 | author: lisaguthrie
|
6 | 7 | ms.author: lcozzens
|
7 | 8 | ms.service: azure-app-configuration
|
8 | 9 | ms.topic: conceptual
|
9 |
| -ms.date: 02/24/2019 |
| 10 | +ms.date: 02/20/2020 |
10 | 11 | ---
|
11 | 12 |
|
12 | 13 | # Point-in-time snapshot
|
13 | 14 |
|
14 |
| -Azure App Configuration keeps records of the precise times when a new key-value pair is created and then modified. These records form a complete timeline in key-value changes. An App Configuration store can reconstruct the history of any key value and replay its past value at any given moment, up to the present. With this feature, you can “time-travel” backward and retrieve an old key value. For example, you can get yesterday's configuration settings, just before the most recent deployment, in order to recover a previous configuration and roll back the application. |
| 15 | +Azure App Configuration maintains a record of changes made to key-value pairs. This records forms a complete timeline of key-value changes, beginning with the creation of each pair, for up to 7 days. An App Configuration store can reconstruct the history of any key-value and provide its past value at any given moment. Using this feature, you can “time-travel” backward and retrieve an old key-value. For example, you can recover configuration settings used prior to the most recent deployment in order to roll back the application to the previous configuration. |
15 | 16 |
|
16 | 17 | ## Key-value retrieval
|
17 | 18 |
|
18 |
| -To retrieve past key values, specify a time at which key values are snapshot in the HTTP header of a REST API call. For example: |
| 19 | +You can use Azure PowerShell to retrieve past key values. 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 | 20 |
|
20 |
| -```rest |
21 |
| -GET /kv HTTP/1.1 |
22 |
| -Accept-Datetime: Sat, 1 Jan 2019 02:10:00 GMT |
| 21 | +[!INCLUDE [cloud-shell-try-it.md](../../../includes/cloud-shell-try-it.md)] |
| 22 | + |
| 23 | +Retrieve all recorded changes to your key-values. |
| 24 | + |
| 25 | +```azurepowershell |
| 26 | +az appconfig revision list --name {your-app-config-store-name}. |
23 | 27 | ```
|
24 | 28 |
|
25 |
| -Currently, App Configuration keeps seven days of change history. |
| 29 | +Retrieve all recorded changes for the key `environment` and the labels `test` and `prod`. |
| 30 | + |
| 31 | +```azurepowershell |
| 32 | +az appconfig revision list --name {your-app-config-store-name} --key environment --label test,prod |
| 33 | +``` |
| 34 | + |
| 35 | +Retrieve all recorded changes in the hierarchical key space `environment:prod`. |
| 36 | + |
| 37 | +```azurepowershell |
| 38 | +az appconfig revision list --name {your-app-config-store-name} --key environment:prod:* |
| 39 | +``` |
| 40 | + |
| 41 | +Retrieve all recorded changes for the key `color` at a specific point-in-time. |
| 42 | + |
| 43 | +```azurepowershell |
| 44 | +az appconfig revision list --connection-string {your-app-config-connection-string} --key color --datetime "2019-05-01T11:24:12Z" |
| 45 | +``` |
| 46 | + |
| 47 | +Retrieve the last 10 recorded changes to your key-values and return only the values for `key`, `label`, and `last-modified` time stamp. |
| 48 | + |
| 49 | +```azurepowershell |
| 50 | +az appconfig revision list --name {your-app-config-store-name} --top 10 --fields key,label,last-modified |
| 51 | +``` |
26 | 52 |
|
27 | 53 | ## Next steps
|
28 | 54 |
|
|
0 commit comments