Skip to content

Allow attaching a cosmos db account with tenantId.#2895

Open
mkrueger wants to merge 2 commits intomainfrom
dev/mkrueger/issue2620
Open

Allow attaching a cosmos db account with tenantId.#2895
mkrueger wants to merge 2 commits intomainfrom
dev/mkrueger/issue2620

Conversation

@mkrueger
Copy link
Member

This pull request adds support for handling Azure Cosmos DB connection strings that use either an AccountKey or a TenantId for authentication, instead of requiring only an AccountKey. The changes update validation, parsing, and storage logic throughout the codebase to recognize and propagate TenantId values, and they add tests to ensure correct parsing. Additionally, the URI handler and workspace model are updated to support the new field.

Cosmos DB connection string handling:

  • Updated validation and user prompts to accept connection strings that include AccountEndpoint and either AccountKey or TenantId, and clarified error messages and placeholders accordingly. [1] [2] [3]
  • Extended the parseCosmosDBConnectionString function and ParsedCosmosDBConnectionString class to extract and store the TenantId property if present. [1] [2] [3]
  • Added tests to ensure correct parsing of connection strings with TenantId and with only AccountEndpoint. [1] [2]

Workspace and storage model updates:

  • Modified the CosmosDBAttachedAccountModel and related logic to include an optional tenantId field, and ensured the field is persisted and propagated where appropriate (e.g., in storage items and account info). [1] [2] [3] [4] [5]

URI handler and parameter propagation:

@mkrueger mkrueger requested a review from sevoku January 16, 2026 13:31
@mkrueger mkrueger requested a review from a team as a code owner January 16, 2026 13:31
sevoku
sevoku previously approved these changes Jan 22, 2026
Copy link
Member

@sevoku sevoku left a comment

Choose a reason for hiding this comment

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

LGTM, tried with using a connection string with a specific tenant Id that is not my default and it works like a charm.

bk201-
bk201- previously approved these changes Feb 2, 2026
@mkrueger mkrueger force-pushed the dev/mkrueger/issue2620 branch from f00f8c0 to fa712c8 Compare February 4, 2026 10:24
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.

Allow attaching a Cosmos DB Account with tenantId (without AccountKey)

3 participants