Skip to content

Using ARG query to support Kusto resource read operations#528

Merged
ArthurMa1978 merged 5 commits intomainfrom
mgmt-kusto
Sep 23, 2025
Merged

Using ARG query to support Kusto resource read operations#528
ArthurMa1978 merged 5 commits intomainfrom
mgmt-kusto

Conversation

@ArthurMa1978
Copy link
Copy Markdown
Member

What does this PR do?

This PR addresses part of the issue tracked in #226 by updating the Kusto tool to eliminate its dependency on Azure.ResourceManager.Kusto.
As a result, it reduces the MCP agent size by approximately 1.01 MB.

GitHub issue number?

#226

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 servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Updated command list in /docs/azmcp-commands.md and/or /docs/fabric-commands.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
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft 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 mcp - pullrequest - live to run Live Test Pipeline

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 refactors the Kusto service implementation to use Azure Resource Graph (ARG) queries instead of direct Azure Resource Manager Kusto API calls, eliminating the dependency on Azure.ResourceManager.Kusto and reducing the MCP agent size by approximately 1.01 MB.

  • Replaced direct ARM API calls with Azure Resource Graph queries for Kusto resource operations
  • Updated all service methods from synchronous to asynchronous patterns (added "Async" suffix)
  • Created new internal data models to replace Azure.ResourceManager.Kusto types

Reviewed Changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.Kusto/src/Services/KustoService.cs Refactored to use ARG queries and async patterns, added new data conversion methods
tools/Azure.Mcp.Tools.Kusto/src/Services/IKustoService.cs Updated interface with async method signatures
tools/Azure.Mcp.Tools.Kusto/src/Models/KustoClusterModel.cs Added new public record for cluster data representation
tools/Azure.Mcp.Tools.Kusto/src/Services/Models/*.cs Added internal data models for JSON deserialization
tools/Azure.Mcp.Tools.Kusto/src/Commands/*.cs Updated all commands to use async service methods
tools/Azure.Mcp.Tools.Kusto/tests/Azure.Mcp.Tools.Kusto.UnitTests/*.cs Updated unit tests to use async method names
tools/Azure.Mcp.Tools.Kusto/src/Azure.Mcp.Tools.Kusto.csproj Removed Azure.ResourceManager.Kusto dependency
Comments suppressed due to low confidence (1)

tools/Azure.Mcp.Tools.Kusto/src/Services/Models/KustoManagedServiceIdentity.cs:1

  • These properties should have setters to support JSON deserialization. Change { get; } to { get; set; } to ensure the JSON deserializer can populate these values.
// Copyright (c) Microsoft Corporation.

Comment thread tools/Azure.Mcp.Tools.Kusto/src/Services/Models/KustoClusterData.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Kusto/src/Services/Models/KustoClusterData.cs
Comment thread tools/Azure.Mcp.Tools.Kusto/src/Services/KustoService.cs
@microsoft microsoft deleted a comment from azure-pipelines Bot Sep 22, 2025
Copy link
Copy Markdown
Contributor

@alzimmermsft alzimmermsft left a comment

Choose a reason for hiding this comment

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

This looks fantastic!

Comment thread tools/Azure.Mcp.Tools.Kusto/src/Services/Models/KustoClusterData.cs
Comment thread tools/Azure.Mcp.Tools.Kusto/src/Services/Models/KustoManagedServiceIdentity.cs Outdated
Comment thread tools/Azure.Mcp.Tools.Kusto/src/Services/Models/KustoSku.cs Outdated
@ArthurMa1978 ArthurMa1978 merged commit 1766421 into main Sep 23, 2025
27 checks passed
@ArthurMa1978 ArthurMa1978 deleted the mgmt-kusto branch September 23, 2025 07:44
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in Azure MCP Server Sep 23, 2025
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Sep 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants