Repository navigation
feat(external-data-sources): Microsoft Fabric SQL endpoint support - #3110
Conversation
…a Entra service principal - SQLServerExternalDataSourceDriver: authMode config, Entra SPN credential shape, pure buildPoolConfig() with forced-encrypt Entra branch, isAuthError AADSTS coverage - Fabric ExternalDataSourceType metadata row (reuses SQLServerExternalDriver) - Unit tests (Entra config building + isAuthError) + gated live integration test - Manual (workflow_dispatch) Fabric CI job in eds-integration.yml
The Fabric authMode scaffolding could not actually connect. Two upstream issues, both fixed here: - tedious 19.2.0 (one patch below tediousjs/tedious#1718) silently drops the fedauth login right after LOGIN7. Floor mssql at ^12.7.0 to pull the fixed tedious (>= 19.2.1). No MJ code imports tedious directly; mssql abstracts it. - Fabric Warehouse rejects SET XACT_ABORT (error 15869), which tedious sends on connect by default. Set abortTransactionOnError: null on the Entra path so it emits neither on/off; the read-only driver never needs it. Adds unit tests for the XACT_ABORT suppression and documents the Fabric requirements in the EDS guide + changeset. Validated end-to-end against a live Fabric warehouse (TestConnection, IntrospectSchema, RunView) via Entra SPN. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nal-source # Conflicts: # package-lock.json # packages/ExternalDataSources/Providers/SQLServer/package.json
🦋 Changeset detectedLatest commit: 5d184e0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 293 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Claude finished @JosueGarcia-BC's task —— View job Migration Review
Result: No migration files to review. This PR contains no The new external-data-source-type row is seeded via a metadata file ( I've submitted a non-blocking |
There was a problem hiding this comment.
Migration Review — No migration files in scope
I reviewed this PR scoped strictly to *.sql files in the migrations/ directory (checking for raw INSERT statements and spCreate* calls that must use hard-coded, deterministic UUID IDs).
Result: this PR contains no files under migrations/, so there is nothing to review against the migration criteria.
The 9 changed files are:
.changeset/eds-fabric-sqlserver.md.github/workflows/eds-integration.ymlguides/EXTERNAL_DATA_SOURCES_GUIDE.mdmetadata/external-data-source-types/.external-data-source-types.jsonpackage-lock.jsonpackages/ExternalDataSources/Providers/SQLServer/package.jsonpackages/ExternalDataSources/Providers/SQLServer/src/SQLServerExternalDataSourceDriver.ts- 2 test files under
packages/ExternalDataSources/Providers/SQLServer/src/__tests__/
One relevant observation (informational, outside the SQL-migration scope): the new external-data-source-type row is seeded via a metadata file (metadata/external-data-source-types/.external-data-source-types.json) pushed with mj sync rather than a SQL migration — which is the correct MemberJunction pattern for lookup/reference data. No SQL INSERT/spCreate migration deterministic-UUID concerns apply here.
No blocking issues from the migration review.
✅ Dependency Check ResultsAll dependencies are properly declared! No missing dependencies detected in this PR. |
…llow-up) Adds a live integration test that self-seeds a NOT ENFORCED foreign key on Fabric Warehouse (via ALTER TABLE — Fabric rejects inline PK/FK in CREATE TABLE) and asserts the driver introspects it into Relationships exactly as for SQL Server. Documents the Fabric FK behavior (NOT ENFORCED / ALTER-only; empty Relationships when absent) in the EDS guide. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Follow-ups from a multi-dimension review (no blockers found): - Fix tedious #1718 link (pointed at issue #1563, the bug report, not the fix PR) in the guide and changeset - Align the Fabric metadata type Description with the SQL Server row (sys.* + FK introspection; note Fabric constraints must be NOT ENFORCED) - Add timeout-minutes to the manual Fabric CI job (only job hitting a live cloud endpoint; avoid the 6-hour default on a hung handshake) - Add unit coverage for the bare invalid_client / invalid client secret isAuthError substrings (previously short-circuited by the AADSTS match) - Assert the FK exists before its Columns in the introspection test Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…nal-source # Conflicts: # package-lock.json # packages/ExternalDataSources/Providers/SQLServer/package.json
Summary
Adds Microsoft Fabric as a supported External Data Source. MemberJunction can now back an Entity or Query with a live Microsoft Fabric Warehouse or Lakehouse SQL analytics endpoint — read at request time through the driver, without replicating the data into the MJ database — using enterprise Microsoft Entra service-principal authentication.
This extends the External Data Sources capability (PostgreSQL, SQL Server, MySQL, Oracle, Snowflake, MongoDB) to Microsoft's Fabric data platform, so Fabric-hosted data becomes first-class in MJ: browsable entities, queryable, and joinable into MJ relationships — the same way any other external source works today.
What this enables
EntityRelationships (e.g. anorders → customersFK becomes a navigable relationship).How it works
Fabric's SQL endpoint is TDS-compatible, so the feature is served by the existing
SQLServerExternalDriverwith a new Entra service-principal auth mode — no separate driver, no separate code path for reads/introspection. A new data-source type (Microsoft Fabric SQL Endpoint (External)) is seeded in metadata pointing at that driver. Everything downstream — introspection, paging, read-only enforcement, caching, CodeGen relationship import — behaves identically to a classic SQL Server source.Configuration
Create a Fabric data source with:
Microsoft Fabric SQL Endpoint (External)tenantId/clientId/clientSecret), created via the Credentials dashboard (encrypted on save). The SP must have access to the Fabric workspace.{ "host": "<workspace>-<warehouse>.datawarehouse.fabric.microsoft.com", "authMode": "entra-service-principal" }authModeis also inferred automatically when the credential carries aclientId.)See the new Microsoft Fabric section in the External Data Sources guide for full details.
Implementation notes
authMode: 'entra-service-principal'on the SQL Server driver's connection config; encryption is forced on for this path (Fabric is TLS-only).SQLServerExternalDriver.mssql ^12.7.0floor on this package. We use the package's own dependency (not an npmoverrides) because overrides don't publish — only a real dependency floor reliably reaches external consumers of the published package. Side effect: mssql 12.7 prefers tedious 20, which needs Node ≥ 22 — a non-issue here (repo is on Node 24; Node 18/20 are EOL), tedious is fully abstracted (no MJ code imports it), and coresqlserver-dataprovidercompiles cleanly on the bump. Core's published contract is unchanged; only this package carries the floor.Connectivity fix (the bulk of the investigation)
Getting the live connection working required two Fabric-specific fixes in the driver:
tedious/node-mssqlhad a bug where a malformedFeatureExtblock in the login packet made Fabric silently drop the connection right after LOGIN7 ("socket hang up", no error). It was fixed upstream in tedious 19.2.1 (tediousjs/tedious#1718, tracked in #1563); we were pinned to 19.2.0, exactly one patch below. Fixed by themssql ^12.7.0floor above.SET XACT_ABORTrejection. Fabric Warehouse rejects that statement (error 15869), which tedious sends on connect by default. The driver setsabortTransactionOnError: nullon the Entra path so it's not emitted; the read-only driver never needs it.Regular SQL Server (username/password) connections are entirely unaffected — both behaviors are gated to the Entra path.
How the root cause was isolated: the driver failed identically everywhere (local + clean CI), which first looked tenant-side — but SSMS connected fine from the same laptop, network, endpoint, and identity, proving it was the Node client library, not Fabric or the environment. Tedious-level packet tracing then pinpointed the fedauth LOGIN7 drop, matching the upstream issue.
Testing
This feature was validated end-to-end against a live Microsoft Fabric warehouse, not just mocks:
SET XACT_ABORTsuppression, and the Entra auth-error signatures that drive credential-rotation self-heal.RUN_FABRIC_INTEGRATION=1, against a real Fabric warehouse via Entra service principal):TestConnection— authenticates and connects.IntrospectSchema— discovers the warehouse's tables/views.RunView— reads real rows through the driver.NOT ENFORCEDFK (the only form Fabric supports, added viaALTER TABLE) and asserts the driver introspects it into MJRelationships, then cleans up.https://database.windows.net) and app identity.workflow_dispatch)fabric-integrationjob runs the full live suite from a fresh GitHub Actions runner with nothing of ours on it — proving the connection works independent of any local machine, and doubling as a reachability check. Bounded withtimeout-minutes. ✅ green.@memberjunction/sqlserver-dataprovider(62-package tree) compiles on the bumped dependency; all existing SQL Server / Postgres / MySQL / Oracle / MongoDB EDS integration jobs stay green.Result: 47 SQL Server provider tests pass (unit + live Fabric incl. FK introspection); all 6 EDS integration CI jobs green, including the manual Fabric job from a clean cloud runner.
🤖 Generated with Claude Code