-
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
base: main
Are you sure you want to change the base?
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.
…re/azure-dev into copilot/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
|
|
@copilot remove the changes to other extensions like azure.ai.finetune. |
Co-authored-by: vhvb1989 <24213737+vhvb1989@users.noreply.github.com>
Removed azure.ai.finetune changes and updated PR description to reflect the full scope of changes:
The PR now accurately describes all changes including the external prompting support, not just the color change. |

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):Documentation (
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
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.