Skip to content

Using ARG query to support Grafana resource read operations#628

Merged
ArthurMa1978 merged 6 commits intomainfrom
mgmt-dashboard
Oct 1, 2025
Merged

Using ARG query to support Grafana resource read operations#628
ArthurMa1978 merged 6 commits intomainfrom
mgmt-dashboard

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 Grafana tool to eliminate its dependency on Azure.ResourceManager.Grafana.
As a result, it reduces the MCP agent size by approximately 587 KB.

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
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • 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 eliminates the dependency on Azure.ResourceManager.Grafana in the Grafana tool by switching to Azure Resource Graph (ARG) queries for resource read operations. This change reduces the MCP agent size by approximately 587 KB while maintaining functionality.

Key changes:

  • Replaced Azure.ResourceManager.Grafana SDK with ARG query implementation
  • Converted the Workspace class to a record-based GrafanaWorkspace model
  • Added new model classes for parsing ARG response data

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Azure.Mcp.Tools.Grafana.csproj Removed Azure.ResourceManager.Grafana package dependency
Directory.Packages.props Removed Azure.ResourceManager.Grafana version specification
GrafanaService.cs Replaced SDK calls with ARG query implementation using BaseAzureResourceService
IGrafanaService.cs Updated return type from Workspace to GrafanaWorkspace
GrafanaWorkspace.cs New record-based model replacing the old Workspace class
ManagedGrafanaData.cs New model for parsing ARG response data
ManagedGrafanaProperties.cs New model for Grafana properties from ARG responses
WorkspaceListCommand.cs Updated to use new GrafanaWorkspace model
GrafanaJsonContext.cs Added JSON serialization support for new models
WorkspaceListCommandTests.cs Updated test data to use new GrafanaWorkspace record syntax
Comments suppressed due to low confidence (1)

tools/Azure.Mcp.Tools.Grafana/src/Services/Models/ManagedGrafanaProperties.cs:1

  • The comment refers to 'Kusto cluster' but this is a Grafana properties class. It should read 'Properties of the Managed Grafana instance.'
// Copyright (c) Microsoft Corporation.

Comment thread tools/Azure.Mcp.Tools.Grafana/src/Services/GrafanaService.cs Outdated
@ArthurMa1978 ArthurMa1978 requested a review from a team as a code owner September 30, 2025 17:51
@github-project-automation github-project-automation Bot moved this from Untriaged to In Progress in Azure MCP Server Oct 1, 2025
@ArthurMa1978 ArthurMa1978 merged commit b790881 into main Oct 1, 2025
26 checks passed
@ArthurMa1978 ArthurMa1978 deleted the mgmt-dashboard branch October 1, 2025 14:32
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Azure MCP Server Oct 1, 2025
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Dec 8, 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