Skip to content

fix: move ai best practice into best practice namespace#1323

Merged
fanyang-mono merged 4 commits intomicrosoft:mainfrom
XiaofuHuang:xiaofhua/move-namespace
Dec 9, 2025
Merged

fix: move ai best practice into best practice namespace#1323
fanyang-mono merged 4 commits intomicrosoft:mainfrom
XiaofuHuang:xiaofhua/move-namespace

Conversation

@XiaofuHuang
Copy link
Copy Markdown
Contributor

@XiaofuHuang XiaofuHuang commented Dec 5, 2025

What does this PR do?

Move Azure AI best practice tool into best practice namespace

GitHub issue number?

#1110
Contributes to #1265

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
    • Validate README.md changes using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • Run .\eng\scripts\Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • 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 tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • 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 /servers/Azure.Mcp.Server/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 consolidates AI application best practices guidance by moving the AIAppBestPracticesCommand from a standalone Azure.Mcp.Tools.AzureAIBestPractices tool into the existing Azure.Mcp.Tools.AzureBestPractices namespace as a subcommand. This refactoring improves organization by grouping all Azure best practices under a single tool.

Key changes:

  • Moved AI app best practices command from separate tool to AzureBestPractices as ai_app subcommand
  • Removed entire Azure.Mcp.Tools.AzureAIBestPractices project and references
  • Updated command name from azureaibestpractices_get to get_bestpractices_ai_app

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.AzureBestPractices/src/Commands/AIAppBestPracticesCommand.cs Added AI app best practices command to AzureBestPractices namespace with updated naming (ai_app)
tools/Azure.Mcp.Tools.AzureBestPractices/src/AzureBestPracticesSetup.cs Registered AIAppBestPracticesCommand as a subcommand under the bestpractices command group
tools/Azure.Mcp.Tools.AzureBestPractices/src/Resources/*.txt Moved AI-related resource files (ai-best-practices-core.txt, ai-background-knowledge.txt, ai-error-patterns.txt) with minor content updates
tools/Azure.Mcp.Tools.AzureBestPractices/tests/Azure.Mcp.Tools.AzureBestPractices.UnitTests/AIAppBestPracticesCommandTests.cs Added comprehensive unit tests for the new AI app best practices command
tools/Azure.Mcp.Tools.AzureAIBestPractices/src/*.cs Removed old standalone tool source files
tools/Azure.Mcp.Tools.AzureAIBestPractices/tests/**/*.cs Removed old test files from standalone tool
servers/Azure.Mcp.Server/src/Program.cs Removed AzureAIBestPracticesSetup registration from server startup
servers/Azure.Mcp.Server/docs/azmcp-commands.md Updated command documentation to reflect new command location under bestpractices
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Moved test prompts from Azure AI Best Practices section to Azure Best Practices section
servers/Azure.Mcp.Server/README.md Removed Azure AI Best Practices from service areas list
core/Azure.Mcp.Core/src/Areas/Server/Resources/azure-rules.txt Updated rule to reference new command name get_bestpractices_ai_app
AzureMcp.sln Removed AzureAIBestPractices project references
.github/CODEOWNERS Updated code ownership to add @XiaofuHuang to AzureBestPractices tool

⚠️ Important Note: While not part of this PR's changed files, the following files also require updates to complete this refactoring:

  1. core/Azure.Mcp.Core/src/Areas/Server/Resources/consolidated-tools.json - Line 1013 still references azureaibestpractices_get and should be updated to get_bestpractices_ai_app
  2. eng/tools/ToolDescriptionEvaluator/prompts/prompts.json - The key azureaibestpractices_get should be renamed to get_bestpractices_ai_app

These files are required to be updated according to the PR checklist item: "For tools with new names, including new tools or renamed tools, update consolidated-tools.json".

Comments suppressed due to low confidence (1)

servers/Azure.Mcp.Server/src/Program.cs:222

  • Incorrect indentation: This line should be indented with 8 spaces to align with the statement above (line 221), but it currently has only 4 spaces of indentation.
        await telemetryService.InitializeAsync();

@XiaofuHuang XiaofuHuang force-pushed the xiaofhua/move-namespace branch 2 times, most recently from d51ec38 to 08a5d30 Compare December 5, 2025 09:07
@XiaofuHuang XiaofuHuang force-pushed the xiaofhua/move-namespace branch from 08a5d30 to 6c0bb32 Compare December 5, 2025 09:51
@XiaofuHuang
Copy link
Copy Markdown
Contributor Author

/azp run mcp - pullrequest - live

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Comment thread core/Azure.Mcp.Core/src/Areas/Server/Resources/azure-rules.txt Outdated
Comment thread core/Azure.Mcp.Core/src/Areas/Server/Resources/azure-rules.txt
Copy link
Copy Markdown
Contributor

@fanyang-mono fanyang-mono left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for the fix!

@fanyang-mono fanyang-mono merged commit d48bb2b into microsoft:main Dec 9, 2025
26 checks passed
@github-project-automation github-project-automation Bot moved this from Untriaged to Done in Azure MCP Server Dec 9, 2025
vcolin7 pushed a commit that referenced this pull request Dec 12, 2025
* fix: move ai best practice into best practice namespace

* fix: avoid misunderstandings of azure best practice and ai best practice

* refactor: remove empty lines in namespace description

* fix: Updated the rule to clearly specify when to call ai best practice
vcolin7 pushed a commit that referenced this pull request Dec 12, 2025
* fix: move ai best practice into best practice namespace

* fix: avoid misunderstandings of azure best practice and ai best practice

* refactor: remove empty lines in namespace description

* fix: Updated the rule to clearly specify when to call ai best practice
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Apr 20, 2026
* fix: move ai best practice into best practice namespace

* fix: avoid misunderstandings of azure best practice and ai best practice

* refactor: remove empty lines in namespace description

* fix: Updated the rule to clearly specify when to call ai best practice
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