mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-07-03 02:25:58 +01:00
Add fix for MPAC Tables account issue
This commit is contained in:
parent
caf4e9f51f
commit
039136794d
@ -419,13 +419,18 @@ function configureEmulator(): Explorer {
|
||||
|
||||
async function fetchAndUpdateKeys(subscriptionId: string, resourceGroup: string, account: string) {
|
||||
try {
|
||||
updateUserContext({ listKeysFetchInProgress: true });
|
||||
console.log("Starting to fetch keys...");
|
||||
const keys = await listKeys(subscriptionId, resourceGroup, account);
|
||||
console.log("Keys fetched:", keys);
|
||||
|
||||
updateUserContext({ masterKey: keys.primaryMasterKey, listKeysFetchInProgress: false });
|
||||
updateUserContext({
|
||||
masterKey: keys.primaryMasterKey,
|
||||
});
|
||||
|
||||
console.log("User context updated with master key.");
|
||||
} catch (error) {
|
||||
updateUserContext({ listKeysFetchInProgress: false });
|
||||
console.error("Error during fetching keys or updating user context:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
@ -483,12 +488,6 @@ async function configurePortal(): Promise<Explorer> {
|
||||
}
|
||||
|
||||
updateContextsFromPortalMessage(inputs);
|
||||
explorer = new Explorer();
|
||||
resolve(explorer);
|
||||
|
||||
if (userContext.apiType === "Postgres" || userContext.apiType === "SQL" || userContext.apiType === "Mongo") {
|
||||
setTimeout(() => explorer.openNPSSurveyDialog(), 3000);
|
||||
}
|
||||
|
||||
const { databaseAccount: account, subscriptionId, resourceGroup } = userContext;
|
||||
|
||||
@ -503,9 +502,7 @@ async function configurePortal(): Promise<Explorer> {
|
||||
dataPlaneRbacEnabled = isDataPlaneRbacSetting === Constants.RBACOptions.setTrueRBACOption;
|
||||
}
|
||||
if (!dataPlaneRbacEnabled) {
|
||||
(async () => {
|
||||
await fetchAndUpdateKeys(subscriptionId, resourceGroup, account.name);
|
||||
})();
|
||||
}
|
||||
|
||||
updateUserContext({ dataPlaneRbacEnabled });
|
||||
@ -514,19 +511,20 @@ async function configurePortal(): Promise<Explorer> {
|
||||
const dataPlaneRbacEnabled = account.properties.disableLocalAuth;
|
||||
|
||||
if (!dataPlaneRbacEnabled) {
|
||||
(async () => {
|
||||
await fetchAndUpdateKeys(subscriptionId, resourceGroup, account.name);
|
||||
})();
|
||||
}
|
||||
|
||||
updateUserContext({ dataPlaneRbacEnabled });
|
||||
useDataPlaneRbac.setState({ dataPlaneRbacEnabled: dataPlaneRbacEnabled });
|
||||
}
|
||||
}
|
||||
else {
|
||||
(async () => {
|
||||
} else {
|
||||
await fetchAndUpdateKeys(subscriptionId, resourceGroup, account.name);
|
||||
})();
|
||||
}
|
||||
|
||||
explorer = new Explorer();
|
||||
resolve(explorer);
|
||||
if (userContext.apiType === "Postgres" || userContext.apiType === "SQL" || userContext.apiType === "Mongo") {
|
||||
setTimeout(() => explorer.openNPSSurveyDialog(), 3000);
|
||||
}
|
||||
|
||||
if (openAction) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user