时间点快照Point-in-time snapshot

Azure 应用程序配置将维护键值更改记录。Azure App Configuration maintains a record of changes made to key-values. 此记录提供键值更改的时间线。This record provides a timeline of key-value changes. 可以重新构造任何键值的历史记录,并在键值历史记录周期(免费层存储为 7 天,标准层存储为 30 天)内的任何时刻提供其过去的值。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.

键值检索Key-value retrieval

可以使用 Azure 门户或 CLI 检索过去的键值。You can use Azure portal or CLI to retrieve past key-values. 在 Azure CLI 中,使用 az appconfig revision list,并添加适当的参数来检索所需的值。In Azure CLI, use az appconfig revision list, adding appropriate parameters to retrieve the required values. 通过提供存储名称 (--name <app-config-store-name>) 或使用连接字符串 (--connection-string <your-connection-string>) 来指定 Azure 应用程序配置实例。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>). 通过指定特定的时间点 (--datetime),并通过指定要返回的最大项数 (--top) 来限制输出。Restrict the output by specifying a specific point in time (--datetime) and by specifying the maximum number of items to return (--top).

检索所记录的所有键值更改。Retrieve all recorded changes to your key-values.

az appconfig revision list --name <your-app-config-store-name>.

检索对键 environment 和标签 testprod 所做的所有记录的更改。Retrieve all recorded changes for the key environment and the labels test and prod.

az appconfig revision list --name <your-app-config-store-name> --key environment --label test,prod

检索层次结构键空间 environment:prod 中的所有记录的更改。Retrieve all recorded changes in the hierarchical key space environment:prod.

az appconfig revision list --name <your-app-config-store-name> --key environment:prod:* 

检索特定时间点的键 color 的所有记录的更改。Retrieve all recorded changes for the key color at a specific point-in-time.

az appconfig revision list --connection-string <your-app-config-connection-string> --key color --datetime "2019-05-01T11:24:12Z" 

检索所记录的最近 10 个键值更改,并仅返回 keylabellast_modified 时间戳的值。Retrieve the last 10 recorded changes to your key-values and return only the values for key, label, and last_modified time stamp.

az appconfig revision list --name <your-app-config-store-name> --top 10 --fields key label last_modified

后续步骤Next steps