Simplify connect samples to only connect and read account metadata#9
Merged
Conversation
Co-authored-by: seesharprun <5067401+seesharprun@users.noreply.github.com>
…ra ID compatibility Co-authored-by: seesharprun <5067401+seesharprun@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
seesharprun
March 18, 2026 18:57
View session
Signed-off-by: Sidney Andrews <sidandrews@microsoft.com>
seesharprun
approved these changes
Mar 19, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies the Cosmos DB “connect” samples (Python and .NET) to perform only an account metadata read after connecting, removing all CRUD/database/container/item operations to keep the samples focused on connectivity validation.
Changes:
- Python sample now only creates a
CosmosClient, callsget_database_account(), and prints the account ID/name. - .NET sample now only creates a
CosmosClient, callsReadAccountAsync(), and prints the account ID/name. - READMEs updated to reflect the simplified behavior and (for .NET) the reduced required role.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| python/002-connect-connection-string/app.py | Removes CRUD logic and reads/prints account metadata only. |
| python/002-connect-connection-string/readme.md | Updates “What this sample does” to match simplified behavior. |
| dotnet/001-connect-passwordless/connect.cs | Removes CRUD logic and reads/prints account metadata only. |
| dotnet/001-connect-passwordless/readme.md | Updates required role and “What this sample does” to match simplified behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Simplifies the connect samples in all languages to only connect to the account and perform a quick metadata read. CRUD operations (create/upsert/query) have been removed from both samples.
Changes
.NET (
001-connect-passwordless)Newtonsoft.Jsonpackage dependency (no longer needed without item types)client.ReadAccountAsync()to read and print the account nameCosmos DB Built-in Data ContributortoCosmos DB Built-in Data Reader; updated "What this sample does" descriptionPython (
002-connect-connection-string)PartitionKeyimport (no longer needed)client.get_database_account()to read and print the account name