Creating a snapshot
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:
-
From the App Configuration console, click Manage Snapshots from the top menu bar.
-
Click Manage Snapshots. The side panel opens up where you will be seeing the New + button.
-
Click the New + button. You will see the page where you need to provide the snapshot details.
-
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 behttps://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.
-
-
Click Save.
-
Once the snapshot is created, it will be listed in the Manage snapshots window.
Create a GitHub snapshot
To promote a snapshot, complete these steps:
-
First create the snapshot as suggested in the above steps.
-
Then you will see your configuration saved and displayed on the screen.
-
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:
-
From the App Configuration console, click Manage Snapshots from the top menu bar.
-
Click Manage Snapshots. The side panel opens up with existing snapshots.
-
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.