@@ -11,9 +11,9 @@ import * as RequestTracing from "./requestTracing/constants";
1111const TCP_ORIGIN = "_origin._tcp" ;
1212const ALT = "_alt" ;
1313const TCP = "_tcp" ;
14- const EndpointSection = "Endpoint" ;
15- const IdSection = "Id" ;
16- const SecretSection = "Secret" ;
14+ const Endpoint = "Endpoint" ;
15+ const Id = "Id" ;
16+ const Secret = "Secret" ;
1717const AzConfigDomainLabel = ".azconfig." ;
1818const AppConfigDomainLabel = ".appconfig." ;
1919const FallbackClientRefreshExpireInterval = 60 * 60 * 1000 ; // 1 hour in milliseconds
@@ -51,10 +51,10 @@ export class ConfigurationClientManager implements IConfigurationClientManager {
5151 options = credentialOrOptions as AzureAppConfigurationOptions ;
5252 this . #clientOptions = getClientOptions ( options ) ;
5353 staticClient = new AppConfigurationClient ( connectionString , this . #clientOptions) ;
54- this . #secret = parseConnectionString ( connectionString , SecretSection ) ;
55- this . #id = parseConnectionString ( connectionString , IdSection ) ;
54+ this . #secret = parseConnectionString ( connectionString , Secret ) ;
55+ this . #id = parseConnectionString ( connectionString , Id ) ;
5656 // TODO: need to check if it's CDN or not
57- this . endpoint = parseConnectionString ( connectionString , EndpointSection ) ;
57+ this . endpoint = parseConnectionString ( connectionString , Endpoint ) ;
5858
5959 } else if ( connectionStringOrEndpoint instanceof URL ) {
6060 const credential = credentialOrOptions as TokenCredential ;
@@ -173,7 +173,7 @@ async function querySrvTargetHost(host) {
173173 if ( isFailoverableEnv ( ) ) {
174174 dns = require ( "dns/promises" ) ;
175175 } else {
176- return results ;
176+ throw new Error ( "Failover is not supported in the current environment." ) ;
177177 }
178178
179179 try {
@@ -215,7 +215,11 @@ async function querySrvTargetHost(host) {
215215 }
216216 }
217217 } catch ( err ) {
218- throw new Error ( `Failed to lookup origin SRV records: ${ err . message } ` ) ;
218+ if ( err . code === "ENOTFOUND" ) {
219+ return results ; // No SRV records found, return empty array
220+ } else {
221+ throw new Error ( `Failed to lookup SRV records: ${ err . message } ` ) ;
222+ }
219223 }
220224
221225 return results ;
@@ -264,7 +268,7 @@ function buildConnectionString(endpoint, secret, id) {
264268 return "" ;
265269 }
266270
267- return `${ EndpointSection } =${ endpoint } ;${ IdSection } =${ id } ;${ SecretSection } =${ secret } ` ;
271+ return `${ Endpoint } =${ endpoint } ;${ Id } =${ id } ;${ Secret } =${ secret } ` ;
268272}
269273
270274/**
0 commit comments