Skip to content

feat(bindings): re-land Azure SP M2M napi + C-ABI surface onto main (mis-merged in #280) - #282

Merged
eric-wang-1990 merged 2 commits into
mainfrom
eric-wang/napi-cabi-azure-sp-reland
Aug 21, 2026
Merged

eric-wang-1990 merged 2 commits into
mainfrom
eric-wang/napi-cabi-azure-sp-reland

Conversation

@eric-wang-1990

Copy link
Copy Markdown
Collaborator

What

Re-lands the napi + C-ABI Azure service-principal M2M surface onto main. These changes were reviewed and "merged" in #280 — but #280 was stacked on #263 (base = eric-wang/azure-service-principal-design), and #263 had already merged to main ~15h earlier. GitHub did not retarget #280's base, so merging #280 pushed its commits into the already-merged (orphaned) #263 branch instead of main. Net result: #280's changes never reached main (its merge commit 53fc45e is not an ancestor of main; main has neither napi AzureSpM2m nor C-ABI set_auth_azure_sp). #263's pyo3/core Azure surface did land.

This PR cherry-picks the two #280 commits onto current main so the napi + C-ABI Azure surface actually lands, through the normal protect-main review + checks.

Contents (identical to the reviewed #280)

  • napi (napi/src/database.rs, napi/index.d.ts): AuthMode::AzureSpM2m + azureClientId/azureClientSecret/azureTenantId?/azureWorkspaceResourceId?; build_auth_config → AuthConfig::azure_service_principal. Mirrors the pyo3 surface.
  • C ABI (src/c_abi/session.rs, include/databricks_kernel.h): kernel_session_config_set_auth_azure_sp(...) + AuthSpec::AzureServicePrincipal → AuthConfig::azure_service_principal (for Go/ODBC).
  • Changelogs (napi/NEXT_CHANGELOG.md, root NEXT_CHANGELOG.md).

Azure U2M needs no new surface on either binding — it rides the existing OAuthU2m / set_auth_u2m.

Verified

Core cargo build + clippy -D warnings clean; all 76 napi tests pass (incl. azure_sp_m2m_*); C-ABI azure_sp_* tests pass; napi loader drift check in sync; full cargo test suite green.

Related

This pull request and its description were written by Isaac.

…he binding

Add AuthMode::AzureSpM2m to the napi binding, mirroring the pyo3
auth_type="azure-sp-m2m" surface added for Python. New ConnectionOptions
fields: azureClientId + azureClientSecret (required), plus optional
azureTenantId (kernel auto-discovers from the workspace /aad/auth redirect
when omitted) and azureWorkspaceResourceId (when set, the kernel also sends
the Azure SP management token + X-Databricks-Azure-Workspace-Resource-Id
header, so an SP with an Azure RBAC role but no workspace membership can
authenticate). The build_auth_config arm forwards to the kernel's
AuthConfig::azure_service_principal; the kernel owns Azure resolution.

Azure AD U2M needs no new mode — it rides the existing AuthMode::OAuthU2m
(the kernel's workspace-federated browser flow, which Azure workspaces
support). Regenerated napi/index.d.ts to match.

Stacked on the pyo3/core azure-sp-m2m PR (#263), which is where
AuthConfig::azure_service_principal lives.

Co-authored-by: Isaac
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>
…or Go/ODBC

Add kernel_session_config_set_auth_azure_sp to the C ABI, so Go/ODBC
consumers can use Azure Entra service-principal M2M — the C-ABI analog of the
pyo3/napi azure-sp-m2m surface. Required azure_client_id + azure_client_secret;
optional azure_tenant_id (NULL -> kernel auto-discovers from the workspace
/aad/auth redirect) and azure_workspace_resource_id (set -> kernel also sends
the Azure SP management token + X-Databricks-Azure-Workspace-Resource-Id
header, for an SP with an Azure RBAC role but no workspace membership).

New AuthSpec::AzureServicePrincipal variant + conversion to
AuthConfig::azure_service_principal (carrying the shared federation client id).
Hand-written header declaration added. Azure AD U2M needs no new setter — it
rides set_auth_u2m (the kernel's workspace-federated browser flow, which Azure
Databricks workspaces support).

Co-authored-by: Isaac
Signed-off-by: eric-wang-1990 <e.wang@databricks.com>

@oss-reviewer-bot oss-reviewer-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No issues identified by the review bot.

@eric-wang-1990
eric-wang-1990 added this pull request to the merge queue Aug 21, 2026
@eric-wang-1990
eric-wang-1990 removed this pull request from the merge queue due to a manual request Aug 21, 2026
@eric-wang-1990
eric-wang-1990 added this pull request to the merge queue Aug 21, 2026
Merged via the queue into main with commit 5e5dea9 Aug 21, 2026
18 checks passed

This branch was previously deployed

1 inactive deployment
azure-prod — 5153bacc Deployed Aug 21, 2026 by eric-wang-1990 via v0 E2E surface #523
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants