Skip to content

azd up fix for postgres and improved CLI help output#524

Merged
mmckechney merged 3 commits into
masterfrom
azd_up_fix
Apr 14, 2026
Merged

azd up fix for postgres and improved CLI help output#524
mmckechney merged 3 commits into
masterfrom
azd_up_fix

Conversation

@mmckechney
Copy link
Copy Markdown
Owner

This pull request introduces several improvements across infrastructure, scripts, and the .NET command-line interface. The main changes include enhanced validation and usability for test scripts, improved command-line help organization via grouped options, infrastructure refactoring for VNet/subnet handling, and a fix to ensure Azure Batch pools are recreated if their network configuration changes.

Infrastructure and Azure Resource Management

  • Refactored the VNet/subnet handling in database.bicep to use an existing VNet resource instead of deploying a new network module. This simplifies the deployment and ensures correct references in virtual network rules. [1] [2] [3]
  • Added a dependency on identityResource for the databases module in main.bicep to ensure proper deployment order.

Azure Batch Pool Management

  • Updated BatchManager.cs to detect mismatches in subnet configuration for Batch pools. If a mismatch is found (since subnets are immutable), the pool is deleted and recreated with the correct network configuration.

Command-Line Interface Usability

  • Introduced grouped help sections for all major commands in the .NET CLI (CommandLineBuilder.Aci.cs, CommandLineBuilder.Batch.cs, CommandLineBuilder.ContainerApp.cs). This organizes options into logical groups, making help output much easier to read and use. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Test Script Improvements

  • Enhanced both run_all_external_tests_in_aci.ps1 and run_dependent_tests_in_aci.ps1 to resolve the -prefix parameter from the environment variable AZURE_NAME_PREFIX if not provided, and display clear error messages if missing. This improves script robustness and user experience. [1] [2] [3]

Infrastructure improvements:

  • Switched VNet/subnet references in database.bicep to use an existing VNet resource, simplifying deployments and ensuring correct subnet IDs in SQL server VNet rules. [1] [2] [3]
  • Added dependsOn for identityResource in the databases module within main.bicep to ensure correct deployment sequencing.

Azure Batch enhancements:

  • Added logic to BatchManager.cs to detect and correct subnet mismatches for Batch pools by deleting and recreating the pool if necessary.

CLI usability:

  • Grouped command-line options into logical sections for all major commands, providing clearer help output and improving user experience. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Test script robustness:

  • Improved test scripts to auto-resolve the -prefix parameter from the environment or prompt the user, reducing errors and setup friction. [1] [2] [3]

- Add IaC support for Azure Database for PostgreSQL Flexible Server, including parameters, deployment logic, and outputs in main.bicep/main.json.
- Update SQL Server VNet rule logic to use direct VNet name reference.
- Add environment variables for PostgreSQL outputs.
- Enhance BatchManager to handle pool subnet changes by recreating pools if needed.
- Downgrade Azure.ResourceManager.AppContainers to 1.4.1.
- Downgrade Microsoft.Data.SqlClient to 6.1.4 across projects for compatibility.
- Minor formatting and whitespace fixes in .csproj files.
Introduces OptionGroup and GroupedHelpAction to enable grouped, visually enhanced help output using Spectre.Console. Adds SetGroupedHelp extension and applies it to all major commands, organizing options under logical headings for improved CLI usability. No changes to command execution logic.
@mmckechney mmckechney merged commit 28fc168 into master Apr 14, 2026
6 checks passed
@mmckechney mmckechney deleted the azd_up_fix branch April 14, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant