IBM Cloud Docs
Snapshots

Snapshots

Snapshots are a way to capture the current configuration of your app or environment and sync the modified config set back to your config git repo. This can help you in versioning, application bootstrapping, rollback, troubleshooting, or audit App Configuration.

Every snapshot configuration will have the collection and environment id associated with it, along with this user can provide their GitHub details where they would like to promote their configurations.

By default, Snapshots displays the list of snapshot in the current App Configuration service instance along with Name, Collection_id associated, Environment_id associated, Git_branch, Git_url, Git_file_path, Git_token, last_sync_time and the date of creation of the snapshot, and the latest date it was updated.

Configure a snapshot

To create a snapshot, complete these steps:

  1. From the App Configuration console, click Manage Snapshots from the top menu bar.

    Manage snapshots
    Figure 1. Manage snapshots in the current App Configuration service instance

  2. Click Manage Snapshots. The side panel opens up where you will be seeing the New + button.

    Configure a snapshot
    Figure 2. App Configuration service creating a new snapshot

  3. Click the New + button. You will see the page where you need to provide the snapshot details.

    Configure a new snapshot
    Figure 3. App Configuration service configuring a new snapshot

    • Name - name of the snapshot.

    • Collection ID - the collection identifier, you can select the value from the dropdown menu.

    • Environment ID - the environment identifier, you can select the value from the dropdown menu.

    • Repository URL - specify the GitHub URL, for example if you want the configuration to be written to organisation GitHub account then here is the URL https://github.{{org_name}}.com/api/v3/repos/{{owner}}/{{repo_name}} or if you want to write to your personal GitHub then the URL will be https://api.github.com/repos/{{owner}}/{{repo_name}}.

    • Branch - Add the branch name, to which you would like to write or update the config file.

    • Folder path URL - Provide the folder path to the file.

    • File name - provide the file name, we only allow .json or .JSON file extension.

    • Git token - provide the git token, this is the Personal access token this needs to be created with basic read, write and update permission. How to create personal access token.

      Make sure you have selected the permissions as in Figure 4 when creating the Git token.

      Permissions to be selected during Git token creation
      Figure 4. Permissions to be selected during Git token creation

  4. Click Save.

  5. Once the snapshot is created, it will be listed in the Manage snapshots window.

    View configured snapshot
    Figure 5. App Configuration service view configured snapshots

Create a GitHub snapshot

To promote a snapshot, complete these steps:

  1. First create the snapshot as suggested in the above steps.

  2. Then you will see your configuration saved and displayed on the screen.

  3. Click on the Create snapshot, if your configuration is correct then you will see the json file will be either updated if already exists, or it will be created if it does not exist.

    You can update the snapshot information using the API 'https://cloud.ibm.com/apidocs/app-configuration?code=go#update-gitconfig'.

Restore a GitHub snapshot

To restore a snapshot from GitHub, complete these steps:

  1. From the App Configuration console, click Manage Snapshots from the top menu bar.

    Manage snapshots
    Figure 6. Manage snapshots in the current App Configuration service instance

  2. Click Manage Snapshots. The side panel opens up with existing snapshots.

  3. Click Restore Snapshot to restore the required configuration to your App Configuration instance.

Only the lastest snapshot stored in GitHub will be restored. Commit based snapshot restore not supported.

Snapshot - overflow menu

The overflow menu for each of the snapshot (three vertical dots) consist of Delete operation.

When Delete option is selected, a confirmation window is displayed to seek confirmation to delete the selected snapshot. Delete option permanently deletes the snapshot, this action cannot be undone.