Allow attaching a cosmos db account with tenantId.#2895
Open
Allow attaching a cosmos db account with tenantId.#2895
Conversation
sevoku
previously approved these changes
Jan 22, 2026
Member
sevoku
left a comment
There was a problem hiding this comment.
LGTM, tried with using a connection string with a specific tenant Id that is not my default and it works like a charm.
48698ec to
780a5fb
Compare
bk201-
previously approved these changes
Feb 2, 2026
f00f8c0 to
fa712c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for handling Azure Cosmos DB connection strings that use either an
AccountKeyor aTenantIdfor authentication, instead of requiring only anAccountKey. The changes update validation, parsing, and storage logic throughout the codebase to recognize and propagateTenantIdvalues, 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:
AccountEndpointand eitherAccountKeyorTenantId, and clarified error messages and placeholders accordingly. [1] [2] [3]parseCosmosDBConnectionStringfunction andParsedCosmosDBConnectionStringclass to extract and store theTenantIdproperty if present. [1] [2] [3]TenantIdand with onlyAccountEndpoint. [1] [2]Workspace and storage model updates:
CosmosDBAttachedAccountModeland related logic to include an optionaltenantIdfield, 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:
tenantIdparameter from URIs, and to store it in attached account storage items if present. [1] [2] [3] [4] [5] [6] [7] [8] [9]Fixes Allow attaching a Cosmos DB Account with tenantId (without AccountKey) #2620