Migrate Event Grid tools to new tool design#3087
Merged
alzimmermsft merged 1 commit intoJul 18, 2026
Merged
Conversation
alzimmermsft
requested review from
KarishmaGhiya,
jairmyree,
jongio,
joshfree,
tmeschter and
vukelich
July 17, 2026 20:13
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the Event Grid toolset to the newer options model where CLI binding/validation is driven by [Option] / [OptionContainer] attributes, removing the legacy RegisterOptions/BindOptions pattern and System.CommandLine usage.
Changes:
- Converted Event Grid commands and option POCOs to attribute-based option binding (and adjusted unit test bases accordingly).
- Refactored Event Grid models to records and simplified some service helper code / JSON context definitions.
- Removed legacy Event Grid option definition infrastructure and
System.CommandLinedependency from the tool project.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Topic/TopicListCommandTests.cs | Switches tests to subscription-aware command test base. |
| tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Subscription/SubscriptionListCommandTests.cs | Switches tests to subscription-aware command test base. |
| tools/Azure.Mcp.Tools.EventGrid/tests/Azure.Mcp.Tools.EventGrid.Tests/Events/EventsPublishCommandTests.cs | Switches tests to subscription-aware command test base. |
| tools/Azure.Mcp.Tools.EventGrid/src/Services/IEventGridService.cs | Updates interface imports to reference moved/used models. |
| tools/Azure.Mcp.Tools.EventGrid/src/Services/EventGridService.cs | Updates event publishing serialization and refactors some model creation helpers. |
| tools/Azure.Mcp.Tools.EventGrid/src/Options/Topic/TopicListOptions.cs | Replaces inherited options with explicit [Option]-based subscription/resource-group/retry options. |
| tools/Azure.Mcp.Tools.EventGrid/src/Options/Subscription/SubscriptionListOptions.cs | Introduces [Option]-based options (topic/location/resource-group/subscription/tenant/retry). |
| tools/Azure.Mcp.Tools.EventGrid/src/Options/Events/EventsPublishOptions.cs | Introduces [Option]-based publish options and required non-nullable inputs. |
| tools/Azure.Mcp.Tools.EventGrid/src/Options/EventGridOptionDescriptions.cs | Adds centralized text for Event Grid option descriptions. |
| tools/Azure.Mcp.Tools.EventGrid/src/Options/EventGridOptionDefinitions.cs | Removes legacy System.CommandLine-based option definitions. |
| tools/Azure.Mcp.Tools.EventGrid/src/Options/BaseEventGridOptions.cs | Removes legacy base options type. |
| tools/Azure.Mcp.Tools.EventGrid/src/Models/EventInputSchemas.cs | Converts schema input POCOs to records for JSON (de)serialization. |
| tools/Azure.Mcp.Tools.EventGrid/src/Models/EventGridTopicInfo.cs | Simplifies record metadata model (drops explicit JsonPropertyName attributes). |
| tools/Azure.Mcp.Tools.EventGrid/src/Models/EventGridSubscriptionInfo.cs | Simplifies record metadata model (drops explicit JsonPropertyName attributes). |
| tools/Azure.Mcp.Tools.EventGrid/src/Models/EventGridEventSchema.cs | Converts schema model to record form. |
| tools/Azure.Mcp.Tools.EventGrid/src/GlobalUsings.cs | Removes Event Grid-specific global usings (previously included System.CommandLine and others). |
| tools/Azure.Mcp.Tools.EventGrid/src/Commands/Topic/TopicListCommand.cs | Migrates to SubscriptionCommand<TOptions,TResult> with attribute-bound options. |
| tools/Azure.Mcp.Tools.EventGrid/src/Commands/Subscription/SubscriptionListCommand.cs | Migrates to AuthenticatedCommand<TOptions,TResult> with custom validation and post-bind subscription resolution. |
| tools/Azure.Mcp.Tools.EventGrid/src/Commands/Events/EventsPublishCommand.cs | Migrates to SubscriptionCommand<TOptions,TResult> and moves schema validation to ValidateOptions. |
| tools/Azure.Mcp.Tools.EventGrid/src/Commands/EventGridJsonContext.cs | Updates JSON context to include models and uses file-scoped partial type form. |
| tools/Azure.Mcp.Tools.EventGrid/src/Commands/BaseEventGridCommand.cs | Removes legacy Event Grid command base type. |
| tools/Azure.Mcp.Tools.EventGrid/src/Azure.Mcp.Tools.EventGrid.csproj | Updates core project reference path and removes System.CommandLine package reference. |
| servers/Azure.Mcp.Server/changelog-entries/1784319125976.yaml | Adds breaking-change entry for Event Grid tool parameter surface changes. |
conniey
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Migrates Event Grid tools to new design where Register and Bind options are based on
Optionattributes.GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationREADME.mdchanges running the script./eng/scripts/Process-PackageReadMe.ps1. See Package READMEToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.jsonbreaking-changelabelservers/Azure.Mcp.Server/docs/azmcp-commands.md./eng/scripts/Update-AzCommandsMetadata.ps1to update tool metadata inazmcp-commands.md(required for CI)servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline