Azure / AppConfiguration-JavaScriptProvider

The configuration provider for consuming data in Azure App Configuration from JavaScript applications like Node or browser apps.
https://github.com/Azure/AppConfiguration
MIT License
9 stars 2 forks source link

Load From CDN #123

Open zhiyuanliang-ms opened 2 weeks ago

zhiyuanliang-ms commented 2 weeks ago

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.

zhiyuanliang-ms commented 2 weeks ago

I reverted the original commit of adding loadFromCdn (#130) to unblock doing release for EXP telemetry changes. We still have the issue with supporting dynamic refresh for CDN scenario:

  1. You are not guaranteed to get the latest etag of sentinal key because cdn's cache may not expired. During refresh we should force cdn to pull the latest etag.

This PR will contains all changes of the complete solution of loading from cdn.

zhiyuanliang-ms commented 2 days ago

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.