Skip to content

Using AOT compact cosmos package#37

Merged
anuchandy merged 2 commits intomicrosoft:mainfrom
anuchandy:aot-cosmos
Aug 22, 2025
Merged

Using AOT compact cosmos package#37
anuchandy merged 2 commits intomicrosoft:mainfrom
anuchandy:aot-cosmos

Conversation

@anuchandy
Copy link
Copy Markdown
Member

@anuchandy anuchandy commented Aug 22, 2025

What does this PR do?

[Provide a clear, concise description of the changes]

PR switches from the AOT-incompatible Microsoft.Azure.Cosmos to the AOT-compatible Microsoft.Azure.Cosmos.Aot version 0.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

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
    • Spelling check passes: .\eng\common\spelling\Invoke-Cspell.ps1
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated README.md documentation
    • Updated command list in /docs/azmcp-commands.md
    • Updated test prompts in /docs/e2eTestPrompts.md
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
  • 👉 For Community (non-Azure team member) PRs:
    • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
    • Manual tests run: added comment /azp run azure - mcp to run Live Test Pipeline

Copilot AI review requested due to automatic review settings August 22, 2025 20:07
@anuchandy anuchandy requested review from a team and xiangyan99 as code owners August 22, 2025 20:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.Cosmos to Microsoft.Azure.Cosmos.Aot version 0.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

Comment thread tools/Azure.Mcp.Tools.Cosmos/src/Services/CosmosService.cs
Comment thread tools/Azure.Mcp.Tools.Cosmos/src/Services/CosmosService.cs
@anuchandy anuchandy self-assigned this Aug 22, 2025
Copy link
Copy Markdown
Member

@hallipr hallipr left a comment

Choose a reason for hiding this comment

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

This is great. No change in tests needed?

@anuchandy
Copy link
Copy Markdown
Member Author

anuchandy commented Aug 22, 2025

@hallipr, thanks! no additional test changes are need other than switching to the streaming overload to upsert

@anuchandy anuchandy enabled auto-merge August 22, 2025 20:46
@anuchandy anuchandy merged commit 63a980c into microsoft:main Aug 22, 2025
26 checks passed
@anuchandy anuchandy deleted the aot-cosmos branch August 22, 2025 21:00
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.

3 participants