Context
The Node SDK uses a custom TokenProvider interface that returns Promise<string> (raw token value). The .NET SDK accepts TokenCredential from Azure.Core, which is the standard interface shared by every @azure/* client library.
Parity gap
// Current Node SDK
export interface TokenProvider {
getAccessTokenAsync(scopes: string[]): Promise<string>;
}
// .NET SDK equivalent (Azure.Core)
public abstract TokenCredential // getToken(TokenRequestContext, CancellationToken): AccessToken
The practical impact:
- Callers using
@azure/identity credentials (DefaultAzureCredential, WorkloadIdentityCredential, etc.) must wrap them in ManagedIdentityTokenProvider — an unnecessary adapter
- The SDK cannot be composed with
@azure/core-auth credential chains (ChainedTokenCredential, custom TokenCredential implementations)
- No access to token expiry (
expiresOnTimestamp) so proactive refresh isn't possible
Proposed change
Replace TokenProvider with TokenCredential from @azure/core-auth:
import { TokenCredential } from "@azure/core-auth";
// ConnectorClientBase constructor becomes:
constructor(connectionRuntimeUrl: string, credential: TokenCredential, options?: ConnectorClientOptions)
@azure/core-auth is already a transitive dependency (via @azure/identity). Promoting it to a direct peer dependency and using TokenCredential directly aligns the Node SDK with every other @azure/* package.
This is a breaking API change — best paired with the @azure/core-rest-pipeline adoption (where BearerTokenCredentialPolicy consumes TokenCredential directly).
Azure SDK guideline
Context
The Node SDK uses a custom
TokenProviderinterface that returnsPromise<string>(raw token value). The .NET SDK acceptsTokenCredentialfromAzure.Core, which is the standard interface shared by every@azure/*client library.Parity gap
The practical impact:
@azure/identitycredentials (DefaultAzureCredential,WorkloadIdentityCredential, etc.) must wrap them inManagedIdentityTokenProvider— an unnecessary adapter@azure/core-authcredential chains (ChainedTokenCredential, customTokenCredentialimplementations)expiresOnTimestamp) so proactive refresh isn't possibleProposed change
Replace
TokenProviderwithTokenCredentialfrom@azure/core-auth:@azure/core-authis already a transitive dependency (via@azure/identity). Promoting it to a direct peer dependency and usingTokenCredentialdirectly aligns the Node SDK with every other@azure/*package.This is a breaking API change — best paired with the
@azure/core-rest-pipelineadoption (whereBearerTokenCredentialPolicyconsumesTokenCredentialdirectly).Azure SDK guideline
TokenCredentialfrom@azure/core-auth