Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor azcosmos client constructor #15705

Merged
merged 2 commits into from
Oct 5, 2021
Merged

Conversation

chlowell
Copy link
Member

@chlowell chlowell commented Oct 5, 2021

The next version of azcore doesn't contain azcore.Credential, so client constructors must be explicit about the credential types they accept. Pretty straightforward here because there's only one credential type. I renamed the constructor NewCosmosClient -> NewClientWithSharedKey to align with upcoming guidelines for the SDK (the "good" name, NewClient, would go to a constructor taking azcore.TokenCredential, i.e. an Azure AD credential).

@chlowell chlowell added Cosmos Client This issue points to a problem in the data-plane of the library. labels Oct 5, 2021
@chlowell chlowell requested a review from ealsur October 5, 2021 16:26
@ealsur
Copy link
Member

ealsur commented Oct 5, 2021

@chlowell The recommendation then is to have NewClient for Azure AD scenarios and NewClientWithSharedKey for the other?

@chlowell
Copy link
Member Author

chlowell commented Oct 5, 2021

Yes.

@ealsur
Copy link
Member

ealsur commented Oct 5, 2021

@chlowell Can you update the README examples please? Then we can merge this in.

https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/data/azcosmos/README.md#create-cosmos-client

@ealsur ealsur merged commit ff3d99d into Azure:main Oct 5, 2021
@chlowell chlowell deleted the cosmos-ctor-refactor branch March 8, 2023 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants