Migrate List Activity Logs tool from @azure to azure monitor command group in az mcp server#720
Merged
Migrate List Activity Logs tool from @azure to azure monitor command group in az mcp server#720
Conversation
…ft/mcp into masalama/activityLogTool
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new Activity Log List command to the Azure Monitor command group, allowing users to retrieve activity logs for Azure resources. The command provides filtering capabilities by time range, event level, and result count.
Key changes:
- New activity log command implementation with comprehensive test coverage
- Integration with Azure Management API for activity log retrieval
- Service layer extension to support activity log operations
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ActivityLogListCommandTests.cs | Comprehensive unit tests for the new activity log list command |
| MonitorService.cs | Extended service with activity log API integration and HTTP client support |
| IMonitorService.cs | Interface extension for activity log operations |
| ActivityLogOptionDefinitions.cs | Command option definitions for activity log parameters |
| ActivityLogListOptions.cs | Options class for activity log command parameters |
| MonitorSetup.cs | Service registration and command group configuration |
| ActivityLogLocalizableString.cs | Model for localizable string properties in activity logs |
| ActivityLogListResponse.cs | Response model for activity log API calls |
| ActivityLogEventLevel.cs | Enumeration for activity log event levels |
| ActivityLogEventData.cs | Main data model for individual activity log events |
| MonitorJsonContext.cs | JSON serialization context updates for new models |
| ActivityLogListCommand.cs | Main command implementation for listing activity logs |
| e2eTestPrompts.md | Test prompt addition for new command |
| azmcp-commands.md | Documentation update with new command usage |
| CHANGELOG.md | Release notes for the new feature |
| prompts.json | Tool description evaluator prompt configuration |
| launch.json | Debug configuration for the new command |
| cspell.json | Spelling dictionary update |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Update default value Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
JasonYeMSFT
reviewed
Oct 7, 2025
JasonYeMSFT
reviewed
Oct 7, 2025
JasonYeMSFT
reviewed
Oct 7, 2025
jongio
requested changes
Oct 7, 2025
17 tasks
JasonYeMSFT
approved these changes
Oct 8, 2025
jongio
reviewed
Oct 8, 2025
jongio
reviewed
Oct 9, 2025
jongio
approved these changes
Oct 9, 2025
colbytimm
pushed a commit
to colbytimm/microsoft-mcp
that referenced
this pull request
Dec 8, 2025
…group in az mcp server (microsoft#720) * implementation of activitylog tool * fix activity log implementation * fix build issues * remove unnecessary file * clean up outdated file * updated activitylog command to complement newer changes to azure mcp * cleanup tests * restore tools.json * Update .vscode/launch.json spelling Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tools/Azure.Mcp.Tools.Monitor/src/Services/IMonitorService.cs Update default value Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tools/Azure.Mcp.Tools.Monitor/src/Services/MonitorService.cs Improving readability per copilot's suggestion Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix test * update monitor service to use IhttpclientService * update parameters in launch json * refactor command to latest design * removed duplicate defaults * fix null scenario unit test * update parameters to correspond with validaterequired param changes * added token caching * updated to use primary constructor * make token caching reusable --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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?
Added List Activity Logs command that list the activity logs of a given Azure resource

Activity Log Documentation: https://learn.microsoft.com/en-us/azure/azure-monitor/platform/activity-log?tabs=log-analytics
GitHub issue number?
[Link to the GitHub issue this PR addresses]Pre-merge Checklist
servers/Azure.Mcp.Server/CHANGELOG.mdand/orservers/Fabric.Mcp.Server/CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies)servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentation/docs/azmcp-commands.mdand/or/docs/fabric-commands.mdToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test prompts/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline