az-bootstrap
az-bootstrap copied to clipboard
Add interactive mode and SkipConfirmation support to Add-AzBootstrapEnvironment
This PR aligns Add-AzBootstrapEnvironment with Invoke-AzBootstrap by adding interactive mode support, SkipConfirmation parameter, and intelligent defaults from existing project configuration.
Key Changes
Interactive Mode Support
- Automatic detection: Function enters interactive mode when required parameters are missing
-
Intelligent defaults: Reads existing
.azbootstrap.jsoncconfiguration to suggest appropriate defaults based on project patterns - User-friendly prompts: Guides users through parameter entry with contextual help
SkipConfirmation Parameter
- Added
-SkipConfirmationswitch parameter to bypass confirmation prompts - Enables automation scenarios while maintaining safety for manual use
- Consistent with
Invoke-AzBootstrapbehavior
Configuration Integration
-
Local config reading: New
Get-AzBootstrapLocalConfigfunction reads repository.azbootstrap.jsonc - Project pattern detection: Automatically derives naming conventions from existing environments
-
Global config integration: Respects global location defaults from
~/.azbootstrap-globals.jsonc
Example Usage
Interactive Mode (new)
# Prompts for missing parameters with intelligent defaults
Add-AzBootstrapEnvironment -EnvironmentName "prod"
Non-Interactive Mode with Confirmation (existing, enhanced)
# Shows summary and prompts for confirmation
Add-AzBootstrapEnvironment -EnvironmentName "test" -ResourceGroupName "rg-myapp-test" -Location "eastus" -PlanManagedIdentityName "mi-myapp-test-plan"
Automated Mode (new)
# Bypasses confirmation for automation
Add-AzBootstrapEnvironment -EnvironmentName "test" -ResourceGroupName "rg-myapp-test" -Location "eastus" -PlanManagedIdentityName "mi-myapp-test-plan" -SkipConfirmation
Implementation Details
New Functions
-
Get-AzBootstrapLocalConfig: Reads and parses repository.azbootstrap.jsoncfiles -
Start-AzBootstrapEnvironmentInteractiveMode: Handles interactive parameter collection with defaults
Updated Functions
-
Add-AzBootstrapEnvironment: Enhanced with interactive mode, confirmation prompts, and configuration integration - Made
ResourceGroupName,Location, andPlanManagedIdentityNameoptional to enable interactive mode
Testing
- Added comprehensive test coverage (10 new tests)
- All existing functionality preserved (31 total tests passing)
- Tests cover both interactive detection and non-interactive modes
Documentation
- Updated README.md with new usage examples
- Enhanced DESIGN.md with architectural details
- Examples show both interactive and automated workflows
Backward Compatibility
- Existing scripts continue to work unchanged
- All parameter defaults and behaviors preserved
- Only new functionality added, no breaking changes
Fixes #51.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.