Enhance a365 config init interactive config wizard#9
Merged
Conversation
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.
Contributor
There was a problem hiding this comment.
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-mcpcommand for managing MCP servers in Dataverse environments with list, publish, unpublish, approve, and block operations - Enhanced configuration handling with
AzureCliServicefor Azure resource detection andConfigurationWizardServicefor 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.ps1script path reference in the documentation is inconsistent with the actual script location. Line 583 says "From scripts/cli directory" but the script is actually atscripts/cli/install-cli.ps1in the repository root, not in adeveloper/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.
…t/Agent365-devTools into users/sellak/developMcp
mengyimicro
previously approved these changes
Nov 14, 2025
mengyimicro
reviewed
Nov 14, 2025
Contributor
mengyimicro
left a comment
There was a problem hiding this comment.
should we update docs/commands/config-init.md for the latest usage?
pontemonti
reviewed
Nov 14, 2025
pontemonti
reviewed
Nov 14, 2025
pontemonti
reviewed
Nov 14, 2025
pontemonti
reviewed
Nov 14, 2025
pontemonti
reviewed
Nov 14, 2025
tmlsousa
previously approved these changes
Nov 14, 2025
rahuldevikar761
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.
874ce3e
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.
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.
tmlsousa
approved these changes
Nov 14, 2025
sellakumaran
added a commit
that referenced
this pull request
Feb 27, 2026
* Add MCP server management commands to Agent 365 CLI 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. * Add verbose logging, input validation, and refactoring 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. * Enhance a365 CLI with interactive config wizard - 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. * Refactor namespaces and simplify logic 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. * Refactor `a365 config init` for usability and clarity 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. * fix: Add retry logic for federated identity credential creation 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. * Update AgentDescription to remove "Demo" designation 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
added a commit
that referenced
this pull request
Mar 8, 2026
…aph, tests) Exit codes (#7, #8/#9): - Set Environment.ExitCode = 1 in ValidateDeploymentPrerequisitesAsync before each null return so callers exit non-zero on config/Web App validation failure - Replace deploy-mcp guard `return` with ExceptionHandler.ExitWithCleanup(1) for AgentBlueprintId, AgenticAppId, and TenantId missing-config cases Log severity (#15, #16, #17): - LogCheckWarning: LogInformation -> LogWarning - LogCheckFailure: all three LogInformation -> LogError - ExecuteCheckWithLoggingAsync warning path: log ErrorMessage ?? Details so the primary warning message is no longer silently dropped skip-graph regressions (#21, #22): - Guard RunChecksOrExitAsync(MOS checks) behind if (!skipGraph) - Guard clientAppId null check behind !skipGraph in PublishCommand Unused parameter (#14): - Remove IPrerequisiteRunner from BlueprintSubcommand.CreateCommand signature - Update SetupCommand.cs call site and BlueprintSubcommandTests accordingly InfrastructureRequirementCheck (#5, #6): - Add I1/I2/I3/I1V2/I2V2/I3V2 (Isolated) SKUs to validation error message - Wrap CheckAsync with ExecuteCheckWithLoggingAsync so [PASS]/[FAIL] is printed PrerequisiteRunner warning message (#3): - Log ErrorMessage ?? Details, log even when both are empty IsCaeError gap (#18): - Add InvalidAuthenticationToken to IsCaeError in ClientAppValidator Stale comment (#10): - Update ValidateDeploymentPrerequisitesAsync doc to remove "environment" Tests (#19, #20): - Add AppServiceAuthRequirementCheckTests (success, failure, metadata, null guard) - Add MosPrerequisitesRequirementCheckTests (exception->failure, metadata, null guards) - Update FrontierPreviewRequirementCheckTests: [WARN] now at LogWarning not LogInformation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sellakumaran
added a commit
that referenced
this pull request
Mar 10, 2026
…siteRunner (#106) (#312) * feat: unify prerequisite validation via IRequirementCheck + IPrerequisiteRunner (#106) Commands now declare prerequisites using IRequirementCheck and fail early with actionable messages before any side effects occur. Phase 1 - pure reorganization (zero behavioral change): - Add AzureAuthRequirementCheck and InfrastructureRequirementCheck adapters - Add IPrerequisiteRunner / PrerequisiteRunner to run checks in order - Route AllSubcommand, BlueprintSubcommand, InfrastructureSubcommand, and DeployCommand through the shared runner instead of ad-hoc validators - Delete dead code: ISubCommand.ValidateAsync, IAzureValidator/AzureValidator - Make AzureAuthValidator.ValidateAuthenticationAsync virtual for testability Phase 2 - minimal early-fail additions: - cleanup azure: auth check before preview display - deploy mcp: explicit early guards for agentBlueprintId and agenticAppId before any Graph/network calls Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: three CLI polish fixes - ConfigFileNotFoundException now extends Agent365Exception so missing config errors surface as clean user messages (no stack trace) on all commands, not just those with local catch blocks. Removes ad-hoc FileNotFoundException catches in CleanupCommand and CreateInstanceCommand. - config init: expand relative/dot deployment paths to absolute before saving so the stored value is portable across directories. Update help text to clarify relative paths are accepted. - config init: drop platform-specific parenthetical from 'Allow public client flows' log message -- the setting is required on all platforms. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Polish CLI output: reduce noise, fix ordering, add TraceId - Move "Running all setup steps..." to after requirements check output - Remove redundant "Agent 365 Setup" header (user already knows the command) - Change CorrelationId log to LogDebug for setup all and blueprint; surface as TraceId inline on the action line ("Running all setup steps... (TraceId: ...)") so it is always captured in setup.log as [INF] and visible on console - Demote PlatformDetector internal logs to LogDebug; single "Detected project platform: X" line remains as the user-facing output - Add AzureAuthRequirementCheck to GetConfigRequirementChecks so Azure auth appears in requirements output for all setup subcommands - Remove redundant mid-execution auth gate from BlueprintSubcommand that caused duplicate [PASS] Azure Authentication output - Fix RequirementCheck base class: use LogInformation for all check result lines to avoid WARNING:/ERROR: prefix doubling from logger formatter - Collapse verbose requirements summary to single line: "Requirements: X passed, Y warnings, Z failed" - Update tests to match new message text and log level assertions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: add fail-early requirement checks to remaining commands Extends fail-early validation to setup infrastructure, setup permissions, setup copilot-studio, cleanup azure, deploy, and publish commands. Each command now runs targeted IRequirementCheck-based pre-flight checks with formatted [PASS]/[FAIL] output before executing destructive or slow operations, surfacing auth and config failures immediately. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor: structured requirement check composition + fix CAE token revocation UX Phase 1 (zero behavioral change): - Add GetBaseChecks() to SetupCommand and CleanupCommand for explicit check composition - Add GetChecks() to each setup subcommand so check lists are co-located with their command - Add RunChecksOrExitAsync() helper to RequirementsSubcommand to eliminate four-line boilerplate - Guard all requirement check calls with if (!dryRun) to avoid spurious network calls - Update RequirementsSubcommandTests to use public API after making internal helpers private Fix CAE token revocation UX: - Add ClientAppValidationException.TokenRevoked() factory for clear re-auth guidance - Detect server-side CAE token revocation in GetClientAppInfoAsync and throw TokenRevoked instead of returning null (which was misreported as "app not found") - Pass suppressErrorLogging: true to all az CLI calls in ClientAppValidator so raw error output no longer leaks to console before the formatted [FAIL] message - Update ClientAppValidatorTests mocks to match suppressErrorLogging parameter Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: suppress raw subprocess output leaking before structured check results AzureAuthValidator: add suppressErrorLogging to az account show call to prevent CommandExecutor from printing raw stderr before [FAIL] output. Remove verbose LogError/LogInformation guidance blocks — the validator returns bool only; issue/resolution messaging belongs in the check layer. PowerShellModulesRequirementCheck: downgrade auto-install progress from LogInformation/LogWarning to LogDebug so they don't print before [PASS]. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: add cleanup azure --dry-run, AppService/MOS checks, update docs - Add `--dry-run` flag to `a365 cleanup azure`: previews resources that would be deleted without requiring Azure auth or making any changes - Add `AppServiceAuthRequirementCheck`: validates App Service deployment token before `a365 deploy`, catching AADSTS50173 token revocation early - Add `MosPrerequisitesRequirementCheck`: validates MOS service principals before `a365 publish` proceeds, converting SetupValidationException to structured failure output - Wire new checks into DeployCommand and PublishCommand via RunChecksOrExitAsync, replacing ad-hoc inline validation - Add `GetChecks(AzureAuthValidator)` to InfrastructureSubcommand for explicit check composition - Add `GetAppServiceTokenAsync` to AzureAuthValidator - Update CLI design.md: add Requirements/ to project structure and document the IRequirementCheck prerequisite validation pattern - Update CHANGELOG.md with user-visible additions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: address PR #312 review comments (exit codes, log levels, skip-graph, tests) Exit codes (#7, #8/#9): - Set Environment.ExitCode = 1 in ValidateDeploymentPrerequisitesAsync before each null return so callers exit non-zero on config/Web App validation failure - Replace deploy-mcp guard `return` with ExceptionHandler.ExitWithCleanup(1) for AgentBlueprintId, AgenticAppId, and TenantId missing-config cases Log severity (#15, #16, #17): - LogCheckWarning: LogInformation -> LogWarning - LogCheckFailure: all three LogInformation -> LogError - ExecuteCheckWithLoggingAsync warning path: log ErrorMessage ?? Details so the primary warning message is no longer silently dropped skip-graph regressions (#21, #22): - Guard RunChecksOrExitAsync(MOS checks) behind if (!skipGraph) - Guard clientAppId null check behind !skipGraph in PublishCommand Unused parameter (#14): - Remove IPrerequisiteRunner from BlueprintSubcommand.CreateCommand signature - Update SetupCommand.cs call site and BlueprintSubcommandTests accordingly InfrastructureRequirementCheck (#5, #6): - Add I1/I2/I3/I1V2/I2V2/I3V2 (Isolated) SKUs to validation error message - Wrap CheckAsync with ExecuteCheckWithLoggingAsync so [PASS]/[FAIL] is printed PrerequisiteRunner warning message (#3): - Log ErrorMessage ?? Details, log even when both are empty IsCaeError gap (#18): - Add InvalidAuthenticationToken to IsCaeError in ClientAppValidator Stale comment (#10): - Update ValidateDeploymentPrerequisitesAsync doc to remove "environment" Tests (#19, #20): - Add AppServiceAuthRequirementCheckTests (success, failure, metadata, null guard) - Add MosPrerequisitesRequirementCheckTests (exception->failure, metadata, null guards) - Update FrontierPreviewRequirementCheckTests: [WARN] now at LogWarning not LogInformation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.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.
a365 config init) with Azure CLI integration, smart defaults, and minimal input requirements.AzureCliServiceandConfigurationWizardServiceto streamline Azure resource detection and configuration.README.mdandDEVELOPER.mdto document new features and usage.ConfigCommandto support file imports, global configurations, and improved logging.AzureAccountInfo,AzureResourceGroup, etc.) to enhance data handling.ProjectSettingsSyncHelperand added utility methods for resource name generation and validation.