Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 8 additions & 30 deletions src/azure-cli/azure/cli/command_modules/postgresql/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,30 +201,18 @@ def _flexible_server_params(command_group):
options_list=['--vnet'],
help='Name or ID of a new or existing virtual network. '
'If you want to use a vnet from different resource group or subscription, '
'please provide a resource ID. The name must be between 2 to 64 characters. '
'provide a resource ID. The name must be between 2 to 64 characters. '
'The name must begin with a letter or number, end with a letter, number or underscore, '
'and may contain only letters, numbers, underscores, periods, or hyphens.'
)

vnet_address_prefix_arg_type = CLIArgumentType(
options_list=['--address-prefixes'],
help='The IP address prefix to use when creating a new virtual network in CIDR format. '
'Default value is 10.0.0.0/16.'
)

subnet_arg_type = CLIArgumentType(
options_list=['--subnet'],
help='Name or resource ID of a new or existing subnet. '
'If you want to use a subnet from different resource group or subscription, please provide resource ID instead of name. '
'Please note that the subnet will be delegated to flexibleServers. '
'If you want to use a subnet from different resource group or subscription, provide a resource ID instead of name. '
'Note that the subnet will be delegated to flexibleServers. '
'After delegation, this subnet cannot be used for any other type of Azure resources.'
Comment on lines +212 to 213
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--subnet help says the subnet “will be delegated to flexibleServers”, but the refactored code path (flexible_server_validate_network + validate_subnet) only formats/returns a subnet resource ID and does not perform delegation. Either reintroduce delegation logic or update the help text so users know they must pre-delegate the subnet themselves.

Suggested change
'Note that the subnet will be delegated to flexibleServers. '
'After delegation, this subnet cannot be used for any other type of Azure resources.'
'Note that the subnet must be delegated to flexibleServers before creating the server. '
'A subnet delegated to flexibleServers cannot be used for any other type of Azure resources.'

Copilot uses AI. Check for mistakes.
)

subnet_address_prefix_arg_type = CLIArgumentType(
options_list=['--subnet-prefixes'],
help='The subnet IP address prefix to use when creating a new subnet in CIDR format. Default value is 10.0.0.0/24.'
)

zone_arg_type = CLIArgumentType(
options_list=['--zone', '-z'],
help='Availability zone into which to provision the resource.'
Expand Down Expand Up @@ -280,16 +268,16 @@ def _flexible_server_params(command_group):
private_dns_zone_arguments_arg_type = CLIArgumentType(
options_list=['--private-dns-zone'],
help='This parameter only applies for a server with private access. '
'The name or id of new or existing private dns zone. '
'You can use the private dns zone from same resource group, different resource group, or different subscription. '
'If you want to use a zone from different resource group or subscription, please provide resource Id. '
'CLI creates a new private dns zone within the same resource group as virtual network if not provided by users.'
'The name or id of new or existing private DNS zone. '
'You can use the private DNS zone from same resource group, different resource group, or different subscription. '
'If you want to use a DNS zone from different resource group or subscription, provide its resource identifier. '
'CLI creates a new private DNS zone within the same resource group as virtual network if not provided by users.'
Comment on lines +271 to +274
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--private-dns-zone help claims “CLI creates a new private DNS zone … if not provided by users”, but the current refactor only computes/validates an ARM ID and no longer creates or links the zone. Either restore the create/link behavior or adjust the help text to avoid promising functionality that isn’t implemented.

Suggested change
'The name or id of new or existing private DNS zone. '
'You can use the private DNS zone from same resource group, different resource group, or different subscription. '
'If you want to use a DNS zone from different resource group or subscription, provide its resource identifier. '
'CLI creates a new private DNS zone within the same resource group as virtual network if not provided by users.'
'The name or resource ID of an existing private DNS zone. '
'You can use a private DNS zone from the same resource group, a different resource group, or a different subscription. '
'If you want to use a DNS zone from a different resource group or subscription, provide its full resource ID. '
'The CLI does not automatically create or link private DNS zones when this parameter is omitted.'

Copilot uses AI. Check for mistakes.
)

restore_point_in_time_arg_type = CLIArgumentType(
options_list=['--restore-time'],
default=get_current_time(),
help='The point in time in UTC to restore from (ISO8601 format), e.g., 2017-04-26T02:10:00+00:00'
help='The point in time in UTC to restore from (ISO8601 format), e.g., 2026-03-22T18:20:22+00:00'
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --restore-time help text is split across two adjacent string literals without a separating space/punctuation, so the rendered help will read like ...+00:00The default value.... Add a space (or period + space) at the end of the first literal or start of the second to keep the help readable.

Suggested change
help='The point in time in UTC to restore from (ISO8601 format), e.g., 2026-03-22T18:20:22+00:00'
help='The point in time in UTC to restore from (ISO8601 format), e.g., 2026-03-22T18:20:22+00:00 '

Copilot uses AI. Check for mistakes.
'The default value is set to current time.'
)

Expand Down Expand Up @@ -420,9 +408,7 @@ def _flexible_server_params(command_group):
c.argument('high_availability', arg_type=high_availability_arg_type, default="Disabled")
c.argument('public_access', arg_type=public_access_create_arg_type)
c.argument('vnet', arg_type=vnet_arg_type)
c.argument('vnet_address_prefix', arg_type=vnet_address_prefix_arg_type)
c.argument('subnet', arg_type=subnet_arg_type)
c.argument('subnet_address_prefix', arg_type=subnet_address_prefix_arg_type)
c.argument('private_dns_zone_arguments', private_dns_zone_arguments_arg_type)
c.argument('zone', zone_arg_type)
c.argument('tags', tags_type)
Expand All @@ -440,9 +426,7 @@ def _flexible_server_params(command_group):
c.argument('restore_point_in_time', arg_type=restore_point_in_time_arg_type)
c.argument('source_server', arg_type=source_server_arg_type)
c.argument('vnet', arg_type=vnet_arg_type)
c.argument('vnet_address_prefix', arg_type=vnet_address_prefix_arg_type)
c.argument('subnet', arg_type=subnet_arg_type)
c.argument('subnet_address_prefix', arg_type=subnet_address_prefix_arg_type)
c.argument('private_dns_zone_arguments', private_dns_zone_arguments_arg_type)
c.argument('zone', arg_type=zone_arg_type)
c.argument('yes', arg_type=yes_arg_type)
Expand All @@ -458,9 +442,7 @@ def _flexible_server_params(command_group):
c.argument('sku_name', arg_type=sku_name_arg_type)
c.argument('source_server', arg_type=source_server_arg_type)
c.argument('vnet', arg_type=vnet_arg_type)
c.argument('vnet_address_prefix', arg_type=vnet_address_prefix_arg_type)
c.argument('subnet', arg_type=subnet_arg_type)
c.argument('subnet_address_prefix', arg_type=subnet_address_prefix_arg_type)
c.argument('private_dns_zone_arguments', private_dns_zone_arguments_arg_type)
c.argument('zone', arg_type=zone_arg_type)
c.argument('yes', arg_type=yes_arg_type)
Expand All @@ -476,9 +458,7 @@ def _flexible_server_params(command_group):
c.argument('sku_name', arg_type=sku_name_arg_type)
c.argument('source_server', arg_type=source_server_arg_type)
c.argument('vnet', arg_type=vnet_arg_type)
c.argument('vnet_address_prefix', arg_type=vnet_address_prefix_arg_type)
c.argument('subnet', arg_type=subnet_arg_type)
c.argument('subnet_address_prefix', arg_type=subnet_address_prefix_arg_type)
c.argument('private_dns_zone_arguments', private_dns_zone_arguments_arg_type)
c.argument('zone', arg_type=zone_arg_type)
c.argument('yes', arg_type=yes_arg_type)
Expand Down Expand Up @@ -619,8 +599,6 @@ def _flexible_server_params(command_group):
c.argument('vnet', arg_type=vnet_arg_type)
c.argument('subnet', arg_type=subnet_arg_type)
c.argument('private_dns_zone_arguments', private_dns_zone_arguments_arg_type)
c.argument('vnet_address_prefix', arg_type=vnet_address_prefix_arg_type)
c.argument('subnet_address_prefix', arg_type=subnet_address_prefix_arg_type)
c.argument('byok_key', arg_type=key_arg_type)
c.argument('byok_identity', arg_type=identity_arg_type)
c.argument('tier', arg_type=tier_arg_type)
Expand Down
Loading
Loading