Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Conversation

KarishmaGhiya
Copy link
Member

@KarishmaGhiya KarishmaGhiya commented Aug 1, 2025

What does this PR do?

Adding database connection to webapp

[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, updated:
    • Updated README.md documentation
    • Updated command list in /docs/azmcp-commands.md
    • Updated test prompts in /e2eTests/e2eTestPrompts.md
  • 👉 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

@KarishmaGhiya KarishmaGhiya moved this from Untriaged to In Progress in Azure MCP Server (OLD) Aug 1, 2025
@KarishmaGhiya KarishmaGhiya marked this pull request as ready for review August 8, 2025 23:40
@Copilot Copilot AI review requested due to automatic review settings August 8, 2025 23:40
@KarishmaGhiya KarishmaGhiya requested a review from a team as a code owner August 8, 2025 23:40
Copy link
Contributor

@Copilot 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 adds database connection functionality to the Azure App Service area, allowing users to configure database connections for web applications through the MCP tool. The implementation includes support for multiple database types (SQL Server, MySQL, PostgreSQL, CosmosDB) with automatic connection string generation.

Key changes:

  • Implements App Service database connection commands and services
  • Adds comprehensive test coverage for both unit and live testing scenarios
  • Updates documentation with new command examples and parameters

Reviewed Changes

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

Show a summary per file
File Description
docs/azmcp-commands.md Documents new appservice database add command with examples and parameters
areas/appservice/tests/test-resources.bicep Defines test infrastructure for App Service and database resources
areas/appservice/tests/AzureMcp.AppService.UnitTests/* Unit tests for AppServiceService and DatabaseAddCommand
areas/appservice/tests/AzureMcp.AppService.LiveTests/* Live integration tests for database commands
areas/appservice/src/AzureMcp.AppService/* Core implementation including services, commands, models, and options
Directory.Packages.props Adds Xunit.SkippableFact package dependency
.vscode/cspell.json Adds spell check entries for appservice and sqlserver

{
var options = BindOptions(parseResult);

try
Copy link
Preview

Copilot AI Aug 8, 2025

Choose a reason for hiding this comment

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

The CHANGELOG.md file needs to be updated to document this new database connection functionality. Add an entry describing the new appservice database add command in the appropriate release section.

Copilot uses AI. Check for mistakes.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed

}

// SQL Server
resource sqlServer 'Microsoft.Sql/servers@2023-05-01-preview' = {
Copy link
Member

Choose a reason for hiding this comment

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

We should consider if we use the sql from the /sql folder. I'm not sure if the deploy-testresources is setup to do dependencies, but I would like to not have to provision to sql servers and databases unless absolutely necessary.

- Service availability issues
- Authentication errors
- Service availability issues
- Authentication errors
Copy link
Member

Choose a reason for hiding this comment

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

Also need to add to e2eprompts.md. Make sure you ask copilot to verify your PR against the checklist in new-command.md

Comment on lines +23 to +26
"""
Add a database connection to an App Service. This command configures database connection
settings for the specified App Service, allowing it to connect to a database server.
""";
Copy link
Member

Choose a reason for hiding this comment

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

Have you tried running the utility in eng\tools\ToolDescriptionConfidenceScore to see if the description is good enough? You can find instructions on how to do that here :)

{
var options = BindOptions(parseResult);

try
Copy link
Member

Choose a reason for hiding this comment

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

Agreed

return context.Response;
}

public record Result(DatabaseConnectionInfo ConnectionInfo);
Copy link
Member

Choose a reason for hiding this comment

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

We've been making the names of these records pretty verbose/descriptive. Should we use Result instead @jongio? After all, if we ever use them in other classes we could do so by using DatabaseAddCommand.Result, for example.


// Assert
Assert.NotNull(response);
Assert.NotEqual(200, response.Status);
Copy link
Member

Choose a reason for hiding this comment

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

I think the response code on an error is 500. We should probably compare against that. Not 200 could be 201, which is still successful according to the REST spec.

@jongio
Copy link
Member

jongio commented Aug 25, 2025

Sorry for the inconvenience, but we have moved the Azure MCP Server source code to https://github.com/microsoft/mcp. This change allows us to build any Microsoft MCP server with the same engineering system and allows us to brand any MCP server with either Azure or Microsoft branding. This repo change means that you need to move this PR to that new repo. Please do so and then add a link here to that new PR. We'll close this PR now and we look forward to seeing this over on the new repo.

@jongio jongio closed this Aug 25, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Azure MCP Server (OLD) Aug 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants