Skip to content

Enhance a365 config init interactive config wizard#9

Merged
sellakumaran merged 9 commits intomainfrom
users/sellak/developMcp
Nov 14, 2025
Merged

Enhance a365 config init interactive config wizard#9
sellakumaran merged 9 commits intomainfrom
users/sellak/developMcp

Conversation

@sellakumaran
Copy link
Contributor

  • Added an interactive configuration wizard (a365 config init) with Azure CLI integration, smart defaults, and minimal input requirements.
  • Introduced AzureCliService and ConfigurationWizardService to streamline Azure resource detection and configuration.
  • Updated README.md and DEVELOPER.md to document new features and usage.
  • Refactored ConfigCommand to support file imports, global configurations, and improved logging.
  • Added models for Azure resources (AzureAccountInfo, AzureResourceGroup, etc.) to enhance data handling.
  • Improved test coverage with new tests for configuration import, Azure CLI interactions, and error handling.
  • Enhanced logging, validation, and error messages for better user experience.
  • Updated ProjectSettingsSyncHelper and added utility methods for resource name generation and validation.

Introduced the `develop-mcp` command for managing MCP servers in
Dataverse environments. Added subcommands for listing environments
and servers, publishing, unpublishing, approving, and blocking MCP
servers. All commands support `--dry-run` and `--config` options.

Updated `README.md` and `DEVELOPER.md` with examples and usage
details for the new commands. Refactored the CLI codebase to include
a new `DevelopMcpCommand` class and models for environments and
servers. Implemented `Agent365ToolingService` for API interactions
with detailed logging and error handling.

Enhanced configuration and logging in `install-cli.ps1`. Added
regression and unit tests to ensure Azure CLI-style parameters,
dry-run functionality, and consistent option patterns. Introduced
`JsonDeserializationHelper` for handling double-serialized JSON
responses. Updated constants and utilities for streamlined
configuration.

Improved developer experience with better error handling and
documentation. Ensured compliance with Azure CLI patterns and added
comprehensive logging for debugging and audit trails.
Enhanced `a365 develop-mcp` commands with a `--verbose` option for detailed logging and improved input validation via a new `InputValidator` class. Simplified configuration handling by making `--config` optional and defaulting to production.

Refactored `Agent365ToolingService` to use constructor-injected environments and adjusted logging levels for better debugging. Improved error handling for API responses and JSON deserialization.

Updated documentation to reflect new features and architecture principles. Added tests for `--verbose` and ensured compliance with the MIT License. General code cleanup for consistency and maintainability.
- Added an interactive configuration wizard (`a365 config init`) with Azure CLI integration, smart defaults, and minimal input requirements.
- Introduced `AzureCliService` and `ConfigurationWizardService` to streamline Azure resource detection and configuration.
- Updated `README.md` and `DEVELOPER.md` to document new features and usage.
- Refactored `ConfigCommand` to support file imports, global configurations, and improved logging.
- Added models for Azure resources (`AzureAccountInfo`, `AzureResourceGroup`, etc.) to enhance data handling.
- Improved test coverage with new tests for configuration import, Azure CLI interactions, and error handling.
- Enhanced logging, validation, and error messages for better user experience.
- Updated `ProjectSettingsSyncHelper` and added utility methods for resource name generation and validation.
Copilot AI review requested due to automatic review settings November 14, 2025 17:12
@sellakumaran sellakumaran requested a review from a team as a code owner November 14, 2025 17:12
Copy link
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 adds an interactive configuration wizard for Agent 365 CLI with Azure CLI integration and introduces MCP (Model Context Protocol) server management capabilities. The changes significantly improve the developer experience by minimizing manual configuration and leveraging existing Azure infrastructure.

Key Changes

  • Added interactive configuration wizard (a365 config init) with Azure CLI integration, smart defaults, and auto-generation of resource names
  • Introduced develop-mcp command for managing MCP servers in Dataverse environments with list, publish, unpublish, approve, and block operations
  • Enhanced configuration handling with AzureCliService for Azure resource detection and ConfigurationWizardService for guided setup
  • Added comprehensive test coverage for Azure CLI interactions, MCP commands, and configuration workflows

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
AzureCliServiceTests.cs New comprehensive test suite for Azure CLI service integration with account info, resource groups, app service plans, and locations
DevelopMcpCommandTests.cs New tests validating MCP command structure, options, aliases, and Azure CLI compliance
DevelopMcpCommandRegressionTests.cs New regression tests ensuring dry-run mode, parameter handling, and service integration work correctly
ConfigCommandTests.cs Updated tests for config command with wizard service integration and improved test infrastructure
IAzureCliService.cs New interface defining Azure CLI interaction methods for account info and resource discovery
IAgent365ToolingService.cs New interface for Agent365 Tooling API operations including MCP server management
JsonDeserializationHelper.cs New helper for handling double-serialized JSON responses from APIs
ConfigurationWizardService.cs New service implementing interactive configuration wizard with Azure CLI integration and validation
AzureCliService.cs New service implementing Azure CLI command execution and JSON response parsing
Agent365ToolingService.cs New service for interacting with Agent365 Tooling API endpoints
Program.cs Updated to add verbose logging support, new service registrations, and environment detection
PublishMcpServerResponse.cs New model for MCP server publish operation responses
PublishMcpServerRequest.cs New model for MCP server publish requests
DataverseMcpServer.cs New models for Dataverse MCP servers with comprehensive properties
DataverseEnvironment.cs New models for Dataverse environments
ConfigDerivedNames.cs New model for configuration-derived resource names
AzureModels.cs New models for Azure account, resource group, app service plan, and location information
ProjectSettingsSyncHelper.cs Updated to sync AgentId to environment variables across platforms
McpConstants.cs Cleaned up unused GetMcpServerBaseUrl method
DevelopMcpCommand.cs New command implementation for MCP server management with input validation and security checks
ConfigCommand.cs Refactored to use wizard service for interactive configuration
DEVELOPER.md Updated with comprehensive documentation for config wizard and develop-mcp command
install-cli.ps1 Updated script path references and build parameters
README.md Updated with improved configuration wizard documentation and MCP server management examples
Comments suppressed due to low confidence (3)

src/Microsoft.Agents.A365.DevTools.Cli/Program.cs:200

  • The catch block silently swallows exceptions when loading config from the specified path. While this may be intentional as a fallback to "prod", it could hide configuration errors. Consider logging the exception at Debug or Warning level to aid troubleshooting, especially since this runs during service configuration.
                catch
                {
                    // If config loading fails, stick with default "prod"
                    // This is fine - the service will work with default environment
                }
            }

src/DEVELOPER.md:584

  • The install-cli.ps1 script path reference in the documentation is inconsistent with the actual script location. Line 583 says "From scripts/cli directory" but the script is actually at scripts/cli/install-cli.ps1 in the repository root, not in a developer/ directory as mentioned in the old comment being replaced.
# From scripts/cli directory
.\install-cli.ps1

src/Microsoft.Agents.A365.DevTools.Cli/Program.cs:199

  • Generic catch clause.
                catch
                {
                    // If config loading fails, stick with default "prod"
                    // This is fine - the service will work with default environment
                }

Refactored `AzureAccountInfo` and `ConfigDerivedNames` classes
to the `Models` namespace for better organization. Updated
`using` directives in `AzureCliService` and `IAzureCliService`
to reflect the namespace changes. Removed unused `userName`
variable from `GenerateDerivedNames` in `ConfigurationWizardService`
to simplify the method logic.
mengyimicro
mengyimicro previously approved these changes Nov 14, 2025
Copy link
Contributor

@mengyimicro mengyimicro left a comment

Choose a reason for hiding this comment

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

should we update docs/commands/config-init.md for the latest usage?

tmlsousa
tmlsousa previously approved these changes Nov 14, 2025
Enhanced the `a365 config init` command with improved documentation, smarter defaults, and better user guidance. Key updates include:

- Updated documentation to emphasize interactive wizard features, Azure CLI integration, and smart defaults.
- Added detailed validation for inputs like project paths, resource groups, and manager emails.
- Introduced a configuration summary and optional name customization step.
- Improved logging for success, errors, and user cancellations.
- Enhanced Azure CLI integration with better error handling and resource discovery.
- Streamlined setup and deployment instructions, removing redundant steps.
- Standardized error messages and improved user feedback throughout the wizard.

These changes improve the overall user experience and robustness of the configuration process.
Copilot AI review requested due to automatic review settings November 14, 2025 19:57
mengyimicro
mengyimicro previously approved these changes Nov 14, 2025
Resolves Request_ResourceNotFound errors during blueprint setup by implementing
exponential backoff retry (5 attempts: 2s, 4s, 8s, 16s, 32s) to handle Azure AD
application object propagation delays.

Previously, the code attempted FIC creation immediately after a 10s delay, which
was insufficient for Azure AD eventual consistency. Now automatically retries with
clear user feedback when propagation errors are detected.
Copy link
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

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

tmlsousa
tmlsousa previously approved these changes Nov 14, 2025
The `AgentDescription` property in the `ConfigurationWizardService` class was updated to remove the word "Demo" from the description. The new value is `"Agent 365 Agent"`, reflecting a shift in naming convention or branding to make the description more general or production-ready.
@sellakumaran sellakumaran merged commit 34b6f17 into main Nov 14, 2025
2 checks passed
@sellakumaran sellakumaran deleted the users/sellak/developMcp branch November 14, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants