|
| 1 | +--- |
| 2 | +title: How to create snapshots (preview) in Azure App Configuration |
| 3 | +description: How to create and manage snapshots Azure App Configuration store. |
| 4 | +author: Muksvso |
| 5 | +ms.author: mubatra |
| 6 | +ms.service: azure-app-configuration |
| 7 | +ms.topic: how-to |
| 8 | +ms.date: 05/16/2023 |
| 9 | +--- |
| 10 | + |
| 11 | +# Use snapshots (preview) |
| 12 | + |
| 13 | +In this article, learn how to create and manage snapshots in Azure App Configuration. Snapshot is a set of App Configuration settings stored in an immutable state. |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +- An App Configuration store. [Create a store](./quickstart-azure-app-configuration-create.md#create-an-app-configuration-store). |
| 18 | +- "DataOwner" role in the App Configuration store. Details on required [role and permissions for snapshots](./concept-snapshots.md) |
| 19 | + |
| 20 | +### Add key-values to the App configuration store |
| 21 | + |
| 22 | +In your App Configuration store, go to **Operations** > **Configuration explorer** and add the following key-values. Leave **Content Type** with its default value. For more information about how to add key-values to a store using the Azure portal or the CLI, go to [Create a key-value](./quickstart-azure-app-configuration-create.md#create-a-key-value). |
| 23 | + |
| 24 | +| Key | Value | Label | |
| 25 | +|----------------|----------------|----------| |
| 26 | +| *app2/bgcolor* | *Light Gray* | *label2* | |
| 27 | +| *app1/color* | *Black* | No label | |
| 28 | +| *app1/color* | *Blue* | *label1* | |
| 29 | +| *app1/color* | *Green* | *label2* | |
| 30 | +| *app1/color* | *Yellow* | *label3* | |
| 31 | +| *app1/message* | *Hello* | *label1* | |
| 32 | +| *app1/message* | *Hi!* | *label2* | |
| 33 | +| *app2/message* | *Good morning!*| *label1* | |
| 34 | + |
| 35 | +## Create a snapshot |
| 36 | + |
| 37 | + > [!IMPORTANT] |
| 38 | + > You may see any error "You are not authorized to view this configuration store data" when you switch to the Snapshots blade in the Azure portal if you opt to use Azure AD authentication in the Configuration explorer or the Feature manager blades. This is a known issue in the Azure portal, and we are working on addressing it. It doesn't affect any scenarios other than the Azure Portal regarding accessing snapshots with Azure AD authentication. |
| 39 | +
|
| 40 | +As a temporary workaround, you can switch to using Access keys authentication from either the Configuration explorer or the Feature manager blades. You should then see the Snapshot blade displayed properly, assuming you have permission for the access keys. |
| 41 | + |
| 42 | +Under **Operations** > **Snapshots (preview)**, select **Create a new snapshot**. |
| 43 | + |
| 44 | +1. Enter a **snapshot name** and optionally also add **Tags**. |
| 45 | +1. Under **Choose the composition type**, keep the default value **Key (default)**. |
| 46 | + - With the *Key* composition type, if your store has identical keys with different labels, only the key-value specified in the last applicable filter is included in the snapshot. Identical key-values with other labels are left out of the snapshot. |
| 47 | + - With the *Key-Label* composition type, if your store has identical keys with different labels, all key-values with identical keys but different labels are included in the snapshot depending on the specified filters. |
| 48 | +1. Select **Add filters** to select the key-values for your snapshot. Filtering is done by selecting filters: **Equals**, **Starts with**, **Any of** and **All** for keys and for labels. You can enter between one and three filters. |
| 49 | + 1. Add the first filter: |
| 50 | + - Under **Key**, select **Starts with** and enter *app1* |
| 51 | + - Under **Label**, select **Equals** and select *label2* from the drop-down menu. |
| 52 | + 1. Add the second filter: |
| 53 | + - Under **Key**, select **Starts with** and enter *app1* |
| 54 | + - Under **Label**, select **Equals** and select *label1* from the drop-down menu. |
| 55 | + |
| 56 | +1. If you archive a snapshot, by default, it will be retained for 30 days after archival. Optionally, under **Recovery options**, decrease the number of retention days the snapshot will be available after archival. |
| 57 | + |
| 58 | + > [!NOTE] |
| 59 | + > The duration of the retention period can't be updated once the snapshot has been created. |
| 60 | +
|
| 61 | +1. Select **Create** to generate the snapshot. In this example, the created snapshot has **Key** composition type and below filters: |
| 62 | + - Keys that start with *app1*, with *label2* label |
| 63 | + - Keys that start with *app1*, with *label1* label. |
| 64 | + |
| 65 | + :::image type="content" source="./media/howto-create-snapshots/create-snapshot.png" alt-text="Screenshot of the Create form with data filled as above steps and Create button highlighted."::: |
| 66 | + |
| 67 | +1. Check the table to understand which key-values from the configuration store end up in the snapshot based on the provided parameters. |
| 68 | + |
| 69 | + | Key | Value | Label | Included in snapshot | |
| 70 | + |----------------|----------------|----------|-------------------------------------------------------------------------------------------------------------------| |
| 71 | + | *app2/bgcolor* | *Light Gray* | *label2* | No: doesn't start with *app1*. |
| 72 | + | *app1/color* | *Black* | No label | No: doesn't have the label *label2* or *label1*. |
| 73 | + | *app1/color* | *Blue* | *label1* | Yes: Has the right label *label1* from the last of applicable filters. |
| 74 | + | *app1/color* | *Green* | *label2* | No: Same key with label *label1* selected by the second filter overrides this one though it has the selected label, *label2*. |
| 75 | + | *app1/color* | *Yellow* | *label3* | No: doesn't have the label *label2* or *label1*. |
| 76 | + | *app1/message* | *Hello* | *label1* | Yes: Has the right label *label1* from the last of applicable filters. |
| 77 | + | *app1/message* | *Hi!* | *label2* | No: Same key with label *label1* selected by the second filter overrides this one though it has the selected label, *label2*. |
| 78 | + | *app2/message* | *Good morning!*| *label1* | No: doesn't start with *app1*. |
| 79 | + |
| 80 | +## Create sample snapshots |
| 81 | + |
| 82 | +To create sample snapshots and check how the snapshots feature work, use the snapshot sandbox. This sandbox contains sample data you can play with to better understand how snapshot's composition type and filters work. |
| 83 | + |
| 84 | +1. In **Operations** > **Snapshots (preview)** > **Active snapshots**, select **Test in sandbox**. |
| 85 | +1. Review the sample data and practice creating snapshots by filling out the form with a composition type and one or more filters. |
| 86 | +1. Select **Create** to generate the sample snapshot. |
| 87 | +1. Check out the snapshot result generated under **Generated sample snapshot**. The sample snapshot displays all keys that are included in the sample snapshot, according to your selection. |
| 88 | + |
| 89 | +## Manage active snapshots |
| 90 | + |
| 91 | +The page under **Operations** > **Snapshots (preview)** displays two tabs: **Active snapshots** and **Archived snapshots**. Select **Active snapshots** to view the list of all active snapshots in an App Configuration store. |
| 92 | + |
| 93 | + :::image type="content" source="./media/howto-create-snapshots/snapshots-view-list.png" alt-text="Screenshot of the list of active snapshots."::: |
| 94 | + |
| 95 | +### View existing snapshot |
| 96 | + |
| 97 | +In the **Active snapshots** tab, select the ellipsis **...** on the right of an existing snapshot and select **View** to view a snapshot. This action opens a Snapshot details page that displays the snapshot's settings and the key-values included in the snapshot. |
| 98 | + |
| 99 | + :::image type="content" source="./media/howto-create-snapshots/snapshot-details-view.png" alt-text="Screenshot of the detailed view of an active snapshot."::: |
| 100 | + |
| 101 | +### Archive a snapshot |
| 102 | + |
| 103 | +In the **Active snapshots** tab, select the ellipsis **...** on the right of an existing snapshot and select **Archive** to archive a snapshot. Confirm archival by selecting **Yes** or cancel with **No**. Once a snapshot has been archived, a notification appears to confirm the operation and the list of active snapshots is updated. |
| 104 | + |
| 105 | + :::image type="content" source="./media/howto-create-snapshots/archive-snapshot.png" alt-text="Screenshot of the archive option in the active snapshots."::: |
| 106 | + |
| 107 | +## Manage archived snapshots |
| 108 | + |
| 109 | +Go to **Operations** > **Snapshots (preview)** > **Archived snapshots** to view the list of all archived snapshots in an App Configuration store. Archived snapshots remain accessible for the retention period that was selected during their creation. |
| 110 | + |
| 111 | + :::image type="content" source="./media/howto-create-snapshots/archived-snapshots.png" alt-text="Screenshot of the list of archived snapshots."::: |
| 112 | + |
| 113 | +### View archived snapshot |
| 114 | + |
| 115 | +Detailed view of snapshot is available in the archive state as well. In the **Archived snapshots** tab, select the ellipsis **...** on the right of an existing snapshot and select **View** to view a snapshot. This action opens a Snapshot details page that displays the snapshot's settings and the key-values included in the snapshot. |
| 116 | + |
| 117 | + :::image type="content" source="./media/howto-create-snapshots/archived-snapshots-details.png" alt-text="Screenshot of the detailed view of an archived snapshot."::: |
| 118 | + |
| 119 | +### Recover an archived snapshot |
| 120 | + |
| 121 | +In the **Archived snapshots** tab, select the ellipsis **...** on the right of an archived snapshot and select **Recover** to recover a snapshot. Confirm App Configuration snapshot recovery by selecting **Yes** or cancel with **No**. Once a snapshot has been recovered, a notification appears to confirm the operation and the list of archived snapshots is updated. |
| 122 | + |
| 123 | + :::image type="content" source="./media/howto-create-snapshots/recover-snapshots.png" alt-text="Screenshot of the recover option in the archived snapshots."::: |
| 124 | + |
| 125 | +## Next steps |
| 126 | + |
| 127 | +> [!div class="nextstepaction"] |
| 128 | +> [Snapshots in Azure App Configuration](./concept-snapshots.md) |
0 commit comments