-
Notifications
You must be signed in to change notification settings - Fork 249
Open
Description
Problem
Developers need to automate the creation of Azure resources in their CI/CD pipelines and scripts without interactive interaction. The current azd add
command requires interactive input, making it difficult to use in automation scenarios. This creates friction for developers who want to script or automate their Azure resource creation workflows.
User Story
I want to add Azure resources to my project using non-interactive commands. I might use this in a repetitive template.
Proposed Solution
Implement a non-interactive mode for the azd add
command that allows specifying all required parameters via command-line flags.
Example usage:
azd add --type ai.project --name search-agent --sub MySub
Acceptance Criteria
-
CLI
- The
azd add
command accepts the following flags:- --type: the type of resource to add (e.g.,
ai.project
) - --name: the name of the resource
- --sub: the subscription to use
- --non-interactive: flag to enable non-interactive mode (optional, defaults to false)
- --optional: azd add --resource_id [full resource ID] as copied from azure portal
- --type: the type of resource to add (e.g.,
- The
-
Functionality
- When all required parameters are provided via flags:
- Command executes without prompting for user input
- Updates azure.yaml with the new resource configuration
- Returns appropriate exit code
- When all required parameters are provided via flags:
-
Error Handling
- Clear error messages when required parameters are missing
- Validation of resource type, name, and subscription
- Checks for naming conflicts with existing resources
-
Documentation updates
- Update CLI documentation to include non-interactive mode
- Add examples for common automation scenarios
- Document all supported resource types for non-interactive mode
-
Test coverage
- Unit tests for non-interactive mode
- Integration tests with mock Azure resources
- Test cases for error conditions and parameter validation
-
Out of Scope
- Changes to existing interactive mode behavior
- Adding new resource types
- Changes to the resource provisioning process
-
Additional Context
- This feature will initially support the
ai.project
resource type - Future iterations may add support for additional resource types
- This feature will initially support the
puicchan
Metadata
Metadata
Assignees
Labels
No labels