-
Notifications
You must be signed in to change notification settings - Fork 268
Add external prompting support to Azure Developer CLI #6605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
|
fix: #6606 |
There was a problem hiding this 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 pull request adds comprehensive external prompting support to the Azure Developer CLI (azd), enabling external tools (like VS Code extensions or custom TUIs) to intercept and handle user prompts. While the PR title focuses on a minor UI color change, the actual implementation is a substantial feature addition.
Changes:
- Implemented external prompting infrastructure with environment variable configuration (
AZD_UI_PROMPT_ENDPOINT,AZD_UI_PROMPT_KEY,AZD_UI_NO_PROMPT_DIALOG) - Added NoPromptDialog feature to allow hosts to receive individual prompts with full option lists instead of batched dialog requests
- Created a comprehensive example implementation in the concurX extension with a prompt server and TUI integration
- Updated documentation to explain both Simple Prompt API and Prompt Dialog API with implementation examples
- Added test coverage for environment variable parsing
- Updated border color in concurX prompt UI from blue (color 27) to cyan (color 87)
- Moved
stretchr/testifyfrom indirect to direct dependency in azure.ai.finetune extension (appropriate as it's used in tests) - Updated Go dependency versions (golang.org/x/net, golang.org/x/term)
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| cli/azd/pkg/input/console.go | Added noPromptDialog field and NoPromptDialog configuration support |
| cli/azd/cmd/container.go | Added environment variable reading for external prompt configuration |
| cli/azd/cmd/external_prompt_test.go | Added tests for environment variable parsing |
| cli/azd/extensions/microsoft.azd.concurx/internal/cmd/prompt_server.go | New HTTP server implementation for receiving external prompts |
| cli/azd/extensions/microsoft.azd.concurx/internal/cmd/prompt_model.go | New Bubble Tea model for rendering prompts with cyan border color |
| cli/azd/extensions/microsoft.azd.concurx/internal/cmd/deployment_model.go | Integration of prompt handling into deployment TUI |
| cli/azd/extensions/microsoft.azd.concurx/internal/cmd/up.go | Wired prompt server into deployment flow |
| cli/azd/extensions/microsoft.azd.concurx/internal/cmd/concurrent_deployer.go | Passes prompt server environment variables to subprocesses |
| cli/azd/docs/external-prompting.md | Comprehensive documentation update with API details and implementation examples |
| cli/azd/extensions/microsoft.azd.concurx/go.mod | Added atotto/clipboard dependency and updated Go module versions |
| cli/azd/extensions/microsoft.azd.concurx/go.sum | Updated checksums for dependency changes |
| cli/azd/extensions/azure.ai.finetune/go.mod | Moved testify from indirect to direct dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…al file systems (#6601) * Initial plan * Add defensive checks for undefined fsPath in VS Code extension commands This fixes the issue where provision and other commands would fail with "The 'path' argument must be of type string. Received undefined" when used with virtual file systems or certain VS Code contexts. Changes: - Added validation for selectedFile.fsPath before calling getWorkingFolder - Provides clear error messages that include URI scheme and selectedItem type - Suppresses automatic issue reporting since this is a user error - Applied fix to all affected commands: provision, deploy, up, down, restore, monitor, packageCli, and pipelineConfig - Added unit tests for the new validation logic Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com> * Simplify provision.test.ts based on code review feedback Removed unused stub functions that weren't actually being used. Simplified tests to focus on the core validation logic. Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com> * Refactor validation logic into shared utility function Based on code review feedback: - Extracted duplicated validation logic to validateFileSystemUri() in cmdUtil.ts - Updated all 8 command files to use the shared function - Simplified test assertions - Improved code maintainability by reducing duplication Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com> * Fix validation to use strict equality check for undefined Changed condition from `!selectedFile.fsPath` to `selectedFile.fsPath === undefined` to avoid incorrectly rejecting empty string paths which are valid for root directories. Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com> * Fix l10n.t() to use single string literal instead of concatenation The first argument to vscode.l10n.t() should be a single string literal for proper localization tooling compatibility. Removed string concatenation and used a single multi-line string literal instead. Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
* Add missing config options --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
* adding project-endpoint to init command * adding 12 preview release * fixig default customization method & adding training type * correct version
* adding project-endpoint to init command * adding 12 preview release * fixig default customization method & adding training type * correct version * adding grader to cloning code * adding missing grader functionality * merging master
* Add a naive attempt at downloading * Address PR comments Signed-off-by: trangevi <trangevi@microsoft.com> * Update download directory as well Signed-off-by: trangevi <trangevi@microsoft.com> * Use net/url parsing in parseGitHubUrlNaive to handle fragments and query params (#6634) * Initial plan * Use net/url parsing to handle query params and fragments in parseGitHubUrlNaive Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com> * Final review completed Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com> * Revert unintended changes to other extensions Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com> * Address PR comments Signed-off-by: trangevi <trangevi@microsoft.com> * Update download directory as well Signed-off-by: trangevi <trangevi@microsoft.com> * Initial plan * Rebased on latest base branch --------- Signed-off-by: trangevi <trangevi@microsoft.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com> Co-authored-by: trangevi <trangevi@microsoft.com> --------- Signed-off-by: trangevi <trangevi@microsoft.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: trangevi <26490000+trangevi@users.noreply.github.com>
* Add extensions option to the azd devcontainer feature to allow specifying extensions to install * Review updates * Revert whitespace changes * Address feedback on shell script. Add multiple extensions to the test config to validate
#6620) * Fix indentation * Add metadata capability checks and improve error handling * Support dynamic suggestions for `azd config` commands * Exclude global persistent flags --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: JeffreyCA <9157833+JeffreyCA@users.noreply.github.com>
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
Fixed lint issues and rebased PR on latest main (commit 0bb1b56). Changes:
The branch is now up to date with main and all lint checks pass. |
|
/azp run azure-dev - cli |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…t/vscode-mkrqfyvm-kps6
|
/ |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
weikanglim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Core changes looks good! Thanks @vhvb1989 !
…anism Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
|
/check-enforcer evaluate |

External Prompting Support for Azure Developer CLI
This PR adds comprehensive external prompting infrastructure to enable external tools (like VS Code extensions or custom TUIs) to intercept and handle user prompts from azd.
Changes to azd Core
External Prompting Infrastructure (
cli/azd/cmd/container.go,cli/azd/pkg/input/console.go):AZD_UI_PROMPT_ENDPOINT,AZD_UI_PROMPT_KEYenvironment variables to configure external prompt serverAZD_UI_NO_PROMPT_DIALOGenvironment variable to disable batched prompt dialogs and get individual prompts with full option lists (e.g., complete Azure location list)SupportsPromptDialog()check to determine whether to batch prompts or send individuallyTesting (
cli/azd/cmd/external_prompt_test.go,cli/azd/pkg/input/console_test.go):TestAskerConsoleExternalPromptto use newExternalPromptConfigurationstructureDocumentation (
cli/azd/docs/external-prompting.md):Changes to concurX Extension
External Prompt Server (
internal/cmd/prompt_server.go):TUI Integration (
internal/cmd/deployment_model.go,internal/cmd/prompt_model.go):Deployment Integration (
internal/cmd/concurrent_deployer.go,internal/cmd/up.go):azd provisionandazd deployKey Features
AZD_UI_NO_PROMPT_DIALOG=1Testing
TestAskerConsoleExternalPrompt)Fixes
#6606
Original prompt
[Chronological Review: The conversation began with the user identifying a problem with command execution in the concurX extension, specifically regarding prompts for values. The user requested modifications to handle external prompting settings and to manage user interactions more effectively. As the conversation progressed, the user reported issues with the subscription selection view and requested UI adjustments to improve usability. The user also explored the implementation of prompts for location and subscription, discussing potential changes to the codebase and documentation. The conversation culminated in requests for specific UI changes, such as color adjustments and documentation updates, followed by commands to implement these changes.][Intent Mapping:
[Technical Inventory:
[Code Archaeology:
[Progress Assessment:
[Context Validation: All critical information regarding prompt handling, UI adjustments, and documentation updates is captured for continuation.]
[Recent Commands Analysis:
1. Conversation Overview: - Primary Objectives: User aims to enhance the concurX extension's prompt handling and UI, specifically addressing issues with subscription and location prompts, and improving user interaction. - Session Context: The conversation flowed from identifying prompt issues to discussing UI adjustments and documentation updates, culminating in specific implementation requests. - User Intent Evolution: The user's needs evolved from troubleshooting prompt issues to requesting specific UI changes and documentation updates.- Technical Foundation:
- Azure Developer CLI (azd): Tool used for managing Azure resources and extensions.
- Bicep: Infrastructure as code framework discussed in relation to prompt handling.
- External Prompting: Concept introduced to improve user interaction with prompts.
- Codebase Status:
- File Name: /home/vivazqu/workspace/azure-dev/build-all.sh
- Purpose: Main script for the concurX extension.
- Current State: User has made modifications related to prompt handling and UI adjustments.
- Key Code Segments: Discussions around the implementation of prompts and UI elements.
- Dependencies: Related to the overall functionality of the concurX extension.
- Problem Resolution:
- Issues Encountered: Problems with prompt visibility and usability in the UI.
- Solutions Implemented: Adjustments to prompt handling and UI elements have been discussed.
- Debugging Context: Ongoing troubleshooting of prompt issues, particularly for location prompts.
- Lessons Learned: Importance of user-friendly UI design and effective prompt handling.
- Progress Tracking:
- Completed Tasks: Initial adjustments to prompt handling have been made.
- Partiall...
Created from VS Code.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.