Skip to content

Commit 03d956d

Browse files
disable replica discovery for CDN
1 parent 811b0e4 commit 03d956d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/load.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { AzureAppConfigurationOptions } from "./AzureAppConfigurationOptions.js"
88
import { ConfigurationClientManager } from "./ConfigurationClientManager.js";
99
import { EtagUrlPipelinePolicy } from "./EtagUrlPipelinePolicy.js";
1010
import { instanceOfTokenCredential } from "./common/utils.js";
11+
import { ArgumentError } from "./common/error.js";
1112

1213
const MIN_DELAY_FOR_UNHANDLED_ERROR: number = 5_000; // 5 seconds
1314

@@ -75,7 +76,11 @@ export async function loadFromCdn(
7576
appConfigOptions?: AzureAppConfigurationOptions
7677
): Promise<AzureAppConfiguration> {
7778
if (appConfigOptions === undefined) {
78-
appConfigOptions = { clientOptions: {}};
79+
appConfigOptions = {
80+
replicaDiscoveryEnabled: false // Disable replica discovery for CDN
81+
};
82+
} else if (appConfigOptions.replicaDiscoveryEnabled) {
83+
throw new ArgumentError("Replica discovery is not supported when loading from CDN.");
7984
}
8085

8186
appConfigOptions.clientOptions = {

0 commit comments

Comments
 (0)