Skip to content

Decouple azure_data_cosmos_driver from azure_core dependency #3845

@tvaron3

Description

@tvaron3

Summary

The azure_data_cosmos_driver crate currently depends on azure_core for HTTP infrastructure, credentials, error types, and utilities. Per the multi-crate versioning strategy, the driver should be independently versionable. The azure_core dependency creates version coupling — breaking changes in azure_core force driver major version bumps even when the driver's own API is stable.

Proposal

Create a new azure_core_shared crate under sdk/core/ that contains:

  • Re-exports of only the HTTP primitive types the driver needs from typespec_client_core (Request, Response, Method, StatusCode, Headers, Policy, Transport, Context, etc.)
  • Credentials (Secret, TokenCredential, AccessToken, TokenRequestOptions) — moved from azure_core::credentials
  • HMAC (hmac_sha256) — moved from azure_core::hmac

azure_core would re-export from the new crate, so existing consumers are unaffected.

Motivation

  • ~90% of what the driver uses from azure_core originates in typespec/typespec_client_core (re-exports)
  • Only credentials and HMAC are truly azure_core-specific
  • typespec_client_core itself includes unused functionality (retry policies, pipeline builder, streaming, etc.)
  • The driver is consumed by azure_data_cosmos_native (C FFI for Java/.NET/Python SDKs) — minimizing deps reduces cross-language complexity

Spec

See: refactor-azure-core-dependency-spec.md

Originally tracked in: Azure/azure-sdk-for-python#45463

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.CosmosThe azure_cosmos crate

Type

No type

Projects

Status

Done

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions