Skip to content

Conversation

@zhiyuanliang-ms
Copy link
Member

@zhiyuanliang-ms zhiyuanliang-ms commented Oct 2, 2025

Snapshot Reference

A snapshot reference is a configuration setting that references a snapshot in the same App Configuration store. When loaded, the provider resolves it and adds all key-values from that snapshot. Using snapshot references enables switching between snapshots at runtime, unlike using a snapshot selector, which requires code changes and/or restarts to switch to a new snapshot.

The content type of a snapshot reference is: "application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8";

Behavior difference from .NET provider

Different from PR #689

The snapshot api design in JS provider is different from .NET provider.
In JS provider, keyvalue and feature flag are fully decoupled. The load and refresh operations for key values and feature flags are performed separatedly. The selector for key value will not load feature flags, vice versa. You must explicitly specify selectors for them.

To load key value or feature flag from snapshot, you must use a snapshot selector i.e. SettingSelector.snapshotName. When you specify a snapshot selector for key values, even if there is any feature flag in that snapshot, the feature flag will not be loaded when loading key values. You must also specify the same snapshot selector in FeatureFlagOptions.

It is a library level choice. We won't break it. So, when resolving a snapshot reference, feature flags in the snapshot will be ignored.

Note: This PR is not ready for review yet. It depends on the Azure JS SDK adding support for snapshot reference types. After that update, I’ll replace all existing helper functions with the SDK ones.

zhiyuanliang-ms and others added 30 commits February 12, 2025 13:23
Merge main to preview
Merge main to preview
* zhiyuanliang/remove-allocation-id-from-main (#176)

* version bump 2.0.1 (#178)

* Add express example (#154)

* add express example

* update

* use middleware

* use token credential

* update

* update

* update

* update

* update

* update

* update

* update

* make client manager endpoint readonly (#179)

* revert revert allocation id change

* fix indent (#181)
Merge pull request #201 from Azure/zhiyuanliang/remove-comment
Merge main to preview
zhiyuanliang-ms and others added 13 commits September 10, 2025 11:42
* Merge pull request #226 from Azure/dependabot/npm_and_yarn/vite-7.1.5

Bump vite from 7.1.4 to 7.1.5

* Bug fix: Provider should continue to refresh when previous refresh operation didn't complete (#225)

* fix refresh all failure bug

* add testcase

---------

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@zhiyuanliang-ms
Copy link
Member Author

Should we handle the case that sentinel key is a snapshot reference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants