Skip to content

Add explicit Azure CLI authentication - #351

Open
parthban-db wants to merge 1 commit into
mainfrom
parthban-db/stack/azure-cli-auth
Open

parthban-db wants to merge 1 commit into
mainfrom
parthban-db/stack/azure-cli-auth

Conversation

@parthban-db

@parthban-db parthban-db commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

🥞 Stacked PR

Use this link to review incremental changes.


Summary

Adds Node.js Azure CLI credentials for Azure Databricks, available only through explicit client configuration.

Why

The VS Code extension supports Azure CLI authentication in the existing SDK and needs equivalent support to complete migration to the modular SDK. The agreed scope is an explicit credential provider, without adding Azure CLI authentication to the default credential chain.

What changed

Interface changes

  • Adds newAzureCliCredentials({tenantId?, subscription?, processTimeoutInMs?}), returning TokenCredentials named azure-cli.
  • Adds AzureCliCredentialsOptions, AzureCliCredentialsError, and AzureCliCredentialsErrorCode to the Node.js credentials entry point.

Behavioral changes

  • Uses an existing az login session to obtain Microsoft Entra tokens for Azure Databricks, with optional tenant, subscription, and CLI timeout selection.
  • Returns bearer headers and token expiry, rejects unusable responses, and preserves token-fetch errors as causes.
  • The default credential chain and browser credential exports are unchanged.

Internal changes

  • Uses Microsoft's @azure/identity rather than implementing subprocess execution and Azure CLI response parsing.
  • Adds usage documentation and tests for option forwarding, token renewal, errors, browser exports, and exclusion from the default credential chain.

How is this tested?

npm run ci, npm run format, and auth test type-checking passed locally. All 20 new Azure CLI unit tests pass. A fake-CLI smoke test exercised the real Azure Identity subprocess path for both expiry formats, option forwarding, error handling, and timeouts. Live Azure authentication was not tested.

@parthban-db
parthban-db force-pushed the parthban-db/stack/azure-cli-auth branch from f0b690e to d65084c Compare October 2, 2026 13:19
@parthban-db
parthban-db force-pushed the parthban-db/stack/azure-cli-auth branch from d65084c to bfc57d5 Compare October 2, 2026 13:25

This branch has not been deployed

No deployments
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.

1 participant