Using AOT compact cosmos package#37
Merged
anuchandy merged 2 commits intomicrosoft:mainfrom Aug 22, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the Azure Cosmos DB integration to support .NET Ahead-of-Time (AOT) compilation by replacing the standard Microsoft.Azure.Cosmos package with the AOT-compatible Microsoft.Azure.Cosmos.Aot package.
- Switched from
Microsoft.Azure.CosmostoMicrosoft.Azure.Cosmos.Aotversion0.1.1-preview.1 - Updated Cosmos service implementation to use stream-based APIs instead of strongly-typed APIs for AOT compatibility
- Modified test fixtures to use System.Text.Json source generation for serialization
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Directory.Packages.props | Updated package references to use AOT-compatible Cosmos packages |
| Azure.Mcp.Tools.Cosmos.csproj | Replaced Microsoft.Azure.Cosmos with Microsoft.Azure.Cosmos.Aot and added Microsoft.HybridRow dependency |
| CosmosService.cs | Refactored to use stream-based APIs and JSON document parsing for database/container listing |
| CosmosDbFixture.cs | Updated test fixture to use System.Text.Json source generation and stream-based operations |
| Program.cs | Moved Cosmos setup from AOT-incompatible section to main registration |
| Azure.Mcp.Server.csproj | Removed Cosmos-specific build exclusions and native file removal targets |
| CHANGELOG.md | Added entry documenting the dependency update for AOT support |
hallipr
approved these changes
Aug 22, 2025
Member
hallipr
left a comment
There was a problem hiding this comment.
This is great. No change in tests needed?
Member
Author
|
@hallipr, thanks! no additional test changes are need other than switching to the streaming overload to upsert |
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.
What does this PR do?
[Provide a clear, concise description of the changes]PR switches from the AOT-incompatible
Microsoft.Azure.Cosmosto the AOT-compatibleMicrosoft.Azure.Cosmos.Aotversion0.1.1-preview.1.[Any additional context, screenshots, or information that helps reviewers]GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies).\eng\common\spelling\Invoke-Cspell.ps1README.mddocumentation/docs/azmcp-commands.md/docs/e2eTestPrompts.mdToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptscrypto mining, spam, data exfiltration, etc.)/azp run azure - mcpto run Live Test Pipeline