diff --git a/src/Common/CosmosClient.ts b/src/Common/CosmosClient.ts index 756c53a2e..14aa882fa 100644 --- a/src/Common/CosmosClient.ts +++ b/src/Common/CosmosClient.ts @@ -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, diff --git a/src/hooks/useKnockoutExplorer.ts b/src/hooks/useKnockoutExplorer.ts index 43e7013a2..765974cad 100644 --- a/src/hooks/useKnockoutExplorer.ts +++ b/src/hooks/useKnockoutExplorer.ts @@ -106,7 +106,11 @@ async function configureHostedWithAAD(config: AAD, explorerParams: ExplorerParam try { keys = await listKeys(subscriptionId, resourceGroup, account.name); } catch (e) { - console.warn(e); + if (userContext.features.enableAadDataPlane) { + console.warn(e); + } else { + throw new Error(`List keys failed: ${e.message}`); + } } updateUserContext({ subscriptionId,