-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load From CDN #123
base: release/v2
Are you sure you want to change the base?
Load From CDN #123
Conversation
I reverted the original commit of adding loadFromCdn (#130) to unblock doing release for EXP telemetry changes.
This PR will contains all changes of the complete solution of loading from cdn. |
…avaScriptProvider into zhiyuanliang/enforce-api-version-for-cdn
…avaScriptProvider into zhiyuanliang/enforce-api-version-for-cdn
1eaa43e
to
62ac2b9
Compare
…avaScriptProvider into zhiyuanliang/register-all-refresh
Changed the target branch to the key value collection monitoring PR's branch #133 , as it will be the recommended way of dynamic refresh for CDN scenario. |
…m/Azure/AppConfiguration-JavaScriptProvider into zhiyuanliang/enforce-api-version-for-cdn
This is blocked for now pending some CDN decisions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 6 out of 12 changed files in this pull request and generated no comments.
Files not reviewed (6)
- package.json: Language not supported
- test/utils/testHelper.ts: Evaluated as low risk
- src/index.ts: Evaluated as low risk
- test/exportedApi.ts: Evaluated as low risk
- test/loadBalance.test.ts: Evaluated as low risk
- src/requestTracing/constants.ts: Evaluated as low risk
Comments suppressed due to low confidence (7)
src/load.ts:50
- [nitpick] The variable name
credentialOrOptions
is ambiguous. It should be renamed tocredentialOrOptionsOrEmptyTokenCredential
.
const appConfiguration = new AzureAppConfigurationImpl(clientManager, options, credentialOrOptions === emptyTokenCredential);
src/AzureAppConfigurationImpl.ts:55
- [nitpick] Consider renaming the property 'etagToBreakCdnCache' to 'cacheBreakEtag' for better readability and consistency.
etagToBreakCdnCache?: string;
src/AzureAppConfigurationImpl.ts:261
- [nitpick] Consider renaming the property 'etagToBreakCdnCache' to 'cacheBreakEtag' for better readability and consistency.
this.#kvSelectorCollection.etagToBreakCdnCache = this.#sentinels.find(s => s.etag !== undefined)?.etag;
src/AzureAppConfigurationImpl.ts:543
- [nitpick] Consider renaming the property 'etagToBreakCdnCache' to 'cacheBreakEtag' for better readability and consistency.
this.#kvSelectorCollection.etagToBreakCdnCache = sentinel.etag;
src/AzureAppConfigurationImpl.ts:606
- [nitpick] Consider renaming the property 'etagToBreakCdnCache' to 'cacheBreakEtag' for better readability and consistency.
selectorCollection.etagToBreakCdnCache = undefined;
src/AzureAppConfigurationImpl.ts:615
- [nitpick] Consider renaming the property 'etagToBreakCdnCache' to 'cacheBreakEtag' for better readability and consistency.
selectorCollection.etagToBreakCdnCache = page.etag;
src/AzureAppConfigurationImpl.ts:623
- [nitpick] Consider renaming the property 'etagToBreakCdnCache' to 'cacheBreakEtag' for better readability and consistency.
selectorCollection.etagToBreakCdnCache = selector.pageEtags[i];
Why this PR?
App Config supports SAS token authentication which targets on the CDN scenario. This PR adds a new API
loadFromCdn
which allows user to load key values from the CDN. Note the CDN can be considered as a proxy and cache for the App Config. The CDN will forward the request to App Config and use SAS token for authentication.For CDN scenario, the recommended way for dynamic refresh is "watch all". We introduced key value collection monitoring based refresh in #133 .
Visible changes
Only the latest preview version of App Config service supports the sas token authentication which the CDN will use.
The latest js sdk allows use to specify the api version manually. ref Updated the dependency of sdk to 1.8.0.
No conditional request will be sent when CDN is used.
To break cdn cache, we will use a pipeline policy to append query param
_=<last-changed-etag>
to all the request sending to cdn.Example: