Fix Fabric native mode

This commit is contained in:
Laurent Nguyen
2025-02-10 13:53:47 +01:00
parent aff4ac2aa8
commit 40d5be6dcb
3 changed files with 10 additions and 10 deletions

View File

@@ -53,9 +53,8 @@ export enum CosmosDbArtifactType {
export interface FabricNativeDatabaseConnectionInfo { export interface FabricNativeDatabaseConnectionInfo {
accessToken: string; accessToken: string;
accountName: string;
databaseName: string; databaseName: string;
connectionString: string; accountEndpoint: string;
} }
export interface CosmosDBTokenResponse { export interface CosmosDBTokenResponse {

View File

@@ -439,7 +439,7 @@ const createExplorerFabric = (params: {
updateUserContext({ updateUserContext({
fabricContext: { fabricContext: {
connectionId: params.connectionId, connectionId: params.connectionId,
mirroredConnectionInfo: undefined, mirroredConnectionInfo: undefined, // Set with resource token response
isReadOnly: params.isReadOnly, isReadOnly: params.isReadOnly,
isVisible: params.isVisible, isVisible: params.isVisible,
artifactType: params.artifactType, artifactType: params.artifactType,
@@ -454,7 +454,7 @@ const createExplorerFabric = (params: {
id: "", id: "",
location: "", location: "",
type: "", type: "",
name: "Mounted", name: "Mounted", // TODO: not used?
kind: AccountKind.Default, kind: AccountKind.Default,
properties: { properties: {
documentEndpoint: undefined, documentEndpoint: undefined,
@@ -462,20 +462,21 @@ const createExplorerFabric = (params: {
}, },
}); });
} else if (params.artifactType === CosmosDbArtifactType.NATIVE) { } else if (params.artifactType === CosmosDbArtifactType.NATIVE) {
// Make it behave like Hosted/AAD/RBAC
updateUserContext({ updateUserContext({
databaseAccount: { databaseAccount: {
id: "", id: "",
location: "", location: "",
type: "", type: "",
name: params.nativeConnectionInfo.accountName, name: "Native", // TODO: not used?
kind: AccountKind.Default, kind: AccountKind.Default,
properties: { properties: {
documentEndpoint: params.nativeConnectionInfo.connectionString, // TODO: verify that <artifactid>.sql.cosmos.fabric.microsoft.com is passed to the client as account endpoint documentEndpoint: params.nativeConnectionInfo.accountEndpoint,
}, },
}, },
// For legacy reasons lots of code expects a connection string login to look and act like an encrypted token login authType: AuthType.AAD,
authType: AuthType.EncryptedToken, dataPlaneRbacEnabled: true,
accessToken: params.nativeConnectionInfo.accessToken, aadToken: params.nativeConnectionInfo.accessToken,
masterKey: undefined, masterKey: undefined,
}); });
} }