Removes feature flag from passing masterKey to SDK (#843)
* Remove Feature flag from master key usage * Adds flag to fallback * format
This commit is contained in:
parent
5417e1e120
commit
69b8196cf0
|
@ -83,7 +83,7 @@ export function client(): Cosmos.CosmosClient {
|
|||
if (_client) return _client;
|
||||
const options: Cosmos.CosmosClientOptions = {
|
||||
endpoint: endpoint() || "https://cosmos.azure.com", // CosmosClient gets upset if we pass a bad URL. This should never actually get called
|
||||
...(!userContext.features.enableAadDataPlane && { key: userContext.masterKey }),
|
||||
key: userContext.masterKey,
|
||||
tokenProvider,
|
||||
connectionPolicy: {
|
||||
enableEndpointDiscovery: false,
|
||||
|
|
|
@ -106,7 +106,11 @@ async function configureHostedWithAAD(config: AAD, explorerParams: ExplorerParam
|
|||
try {
|
||||
keys = await listKeys(subscriptionId, resourceGroup, account.name);
|
||||
} catch (e) {
|
||||
if (userContext.features.enableAadDataPlane) {
|
||||
console.warn(e);
|
||||
} else {
|
||||
throw new Error(`List keys failed: ${e.message}`);
|
||||
}
|
||||
}
|
||||
updateUserContext({
|
||||
subscriptionId,
|
||||
|
|
Loading…
Reference in New Issue