diff --git a/src/Common/Constants.ts b/src/Common/Constants.ts index 4d56c53d9..8458bc0c0 100644 --- a/src/Common/Constants.ts +++ b/src/Common/Constants.ts @@ -134,6 +134,7 @@ export class Features { public static readonly enableAutoPilotV2 = "enableautopilotv2"; public static readonly ttl90Days = "ttl90days"; public static readonly enableRightPanelV2 = "enablerightpanelv2"; + public static readonly enableSDKoperations = "enablesdkoperations"; } export class AfecFeatures { diff --git a/src/Common/dataAccess/deleteCollection.ts b/src/Common/dataAccess/deleteCollection.ts index 9be2fcce0..75d282fce 100644 --- a/src/Common/dataAccess/deleteCollection.ts +++ b/src/Common/dataAccess/deleteCollection.ts @@ -15,7 +15,7 @@ import { refreshCachedResources } from "../DataAccessUtilityBase"; export async function deleteCollection(databaseId: string, collectionId: string): Promise { const clearMessage = logConsoleProgress(`Deleting container ${collectionId}`); try { - if (window.authType === AuthType.AAD) { + if (window.authType === AuthType.AAD && !userContext.useSDKOperations) { await deleteCollectionWithARM(databaseId, collectionId); } else { await client() diff --git a/src/Common/dataAccess/deleteDatabase.ts b/src/Common/dataAccess/deleteDatabase.ts index c92a9aa66..4a2767d0f 100644 --- a/src/Common/dataAccess/deleteDatabase.ts +++ b/src/Common/dataAccess/deleteDatabase.ts @@ -15,7 +15,11 @@ export async function deleteDatabase(databaseId: string): Promise { const clearMessage = logConsoleProgress(`Deleting database ${databaseId}`); try { - if (window.authType === AuthType.AAD && userContext.defaultExperience !== DefaultAccountExperienceType.Table) { + if ( + window.authType === AuthType.AAD && + userContext.defaultExperience !== DefaultAccountExperienceType.Table && + !userContext.useSDKOperations + ) { await deleteDatabaseWithARM(databaseId); } else { await client() diff --git a/src/Common/dataAccess/readCollections.ts b/src/Common/dataAccess/readCollections.ts index 79cecc077..6ebca7b13 100644 --- a/src/Common/dataAccess/readCollections.ts +++ b/src/Common/dataAccess/readCollections.ts @@ -18,6 +18,7 @@ export async function readCollections(databaseId: string): Promise { try { if ( window.authType === AuthType.AAD && + !userContext.useSDKOperations && userContext.defaultExperience !== DefaultAccountExperienceType.MongoDB && - userContext.defaultExperience !== DefaultAccountExperienceType.Table + userContext.defaultExperience !== DefaultAccountExperienceType.Table && + userContext.defaultExperience !== DefaultAccountExperienceType.Cassandra ) { databases = await readDatabasesWithARM(); } else { diff --git a/src/Explorer/Explorer.ts b/src/Explorer/Explorer.ts index 81a7ff2ac..3b7810e79 100644 --- a/src/Explorer/Explorer.ts +++ b/src/Explorer/Explorer.ts @@ -975,6 +975,10 @@ export default class Explorer { this.sparkClusterConnectionInfo.valueHasMutated(); } + if (this.isFeatureEnabled(Constants.Features.enableSDKoperations)) { + updateUserContext({ useSDKOperations: true }); + } + featureSubcription.dispose(); }); diff --git a/src/UserContext.ts b/src/UserContext.ts index e9b4f6e62..2cba6a417 100644 --- a/src/UserContext.ts +++ b/src/UserContext.ts @@ -11,6 +11,7 @@ interface UserContext { authorizationToken?: string; resourceToken?: string; defaultExperience?: DefaultAccountExperienceType; + useSDKOperations?: boolean; } const userContext: Readonly = {} as const;