Skip to content
Merged
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
4 changes: 4 additions & 0 deletions src/azure-cli/azure/cli/command_modules/sql/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,8 @@
text: az sql mi create -g mygroup -n myinstance -l mylocation -i -u myusername -p mypassword --subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNETName}/subnets/{SubnetName} --am Windows
- name: Create GPv2 managed instance with specified IOPS limit
text: az sql mi create -g mygroup -n myinstance -l mylocation -i -u myusername -p mypassword --subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNETName}/subnets/{SubnetName} -e GeneralPurpose --gpv2 true -f Gen8IH -c 4 --storage 256GB --iops 3000
- name: Create managed instance with specified memory size in GB
text: az sql mi create -g mygroup -n myinstance -l mylocation -i -u myusername -p mypassword --subnet /subscriptions/{SubID}/resourceGroups/{ResourceGroup}/providers/Microsoft.Network/virtualNetworks/{VNETName}/subnets/{SubnetName} -e GeneralPurpose --gpv2 true -f Gen8IM -c 4 --storage 256GB --iops 3000 --memory 40
"""

helps['sql mi delete'] = """
Expand Down Expand Up @@ -1083,6 +1085,8 @@
text: az sql mi update -g mygroup -n myinstance --am Windows
- name: Update managed instance to GPv2 with specified IOPS limit
text: az sql mi update -g mygroup -n myinstance -e GeneralPurpose --gpv2 true --iops 3000
- name: Update managed instance to use a specified memory size in GB
text: az sql mi update -g mygroup -n myinstance -e GeneralPurpose --memory 40
"""

helps['sql midb'] = """
Expand Down
11 changes: 11 additions & 0 deletions src/azure-cli/azure/cli/command_modules/sql/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,10 @@ def get_location_type_with_default_from_resource_group(cli_ctx):
help='Preferred metadata to use for authentication of synced on-prem users. Default is AzureAD.',
arg_type=get_enum_type(['AzureAD', 'Windows', 'Paired']))

memory_size_type = CLIArgumentType(
options_list=['--memory'],
help='The memory size in gigabytes (GB).')

db_service_objective_examples = 'Basic, S0, P1, GP_Gen4_1, GP_S_Gen5_8, BC_Gen5_2, HS_Gen5_32.'
dw_service_objective_examples = 'DW100, DW1000c'

Expand Down Expand Up @@ -2326,6 +2330,12 @@ def _configure_security_policy_storage_params(arg_ctx):
arg_type=capacity_param_type,
help='The capacity of the managed instance in integer number of vcores.')

c.argument('memory_size_in_gb',
options_list=['--memory'],
arg_type=memory_size_type,
help='The memory size of the managed instance.'
' Memory size must be specified in GB')

c.argument('collation',
help='The collation of the managed instance.')

Expand Down Expand Up @@ -2395,6 +2405,7 @@ def _configure_security_policy_storage_params(arg_ctx):
'minimal_tls_version',
'virtual_network_subnet_id',
'vcores',
'memory_size_in_gb',
'storage_size_in_gb',
'storage_iops',
'collation',
Expand Down
7 changes: 7 additions & 0 deletions src/azure-cli/azure/cli/command_modules/sql/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -5369,6 +5369,7 @@ def managed_instance_update( # pylint: disable=too-many-locals
administrator_login_password=None,
license_type=None,
vcores=None,
memory_size_in_gb=None,
storage_size_in_gb=None,
storage_iops=None,
assign_identity=False,
Expand Down Expand Up @@ -5425,6 +5426,8 @@ def managed_instance_update( # pylint: disable=too-many-locals
license_type or instance.license_type)
instance.v_cores = (
vcores or instance.v_cores)
instance.memory_size_in_gb = (
memory_size_in_gb or instance.memory_size_in_gb)
instance.storage_size_in_gb = (
storage_size_in_gb or instance.storage_size_in_gb)
instance.storage_iops = storage_iops
Expand Down Expand Up @@ -5456,6 +5459,10 @@ def managed_instance_update( # pylint: disable=too-many-locals
instance.requested_backup_storage_redundancy = requested_backup_storage_redundancy
instance.zone_redundant = None

# Have to set requested logical avail zone to none explicitly otherwise requests will fail
# as the default value is string 'NoPreference' which is invalid for update requests currently
instance.requested_logical_availability_zone = None

if public_data_endpoint_enabled is not None:
instance.public_data_endpoint_enabled = public_data_endpoint_enabled

Expand Down
Loading