diff --git a/src/azure-cli/azure/cli/command_modules/sql/_params.py b/src/azure-cli/azure/cli/command_modules/sql/_params.py index 87f92f91823..7063e45b824 100644 --- a/src/azure-cli/azure/cli/command_modules/sql/_params.py +++ b/src/azure-cli/azure/cli/command_modules/sql/_params.py @@ -371,9 +371,6 @@ def _configure_db_dw_params(arg_ctx): arg_ctx.argument('zone_redundant', arg_type=zone_redundant_param_type) - arg_ctx.argument('storage_account_type', - arg_type=backup_storage_redundancy_param_type) - def _configure_db_dw_create_params( arg_ctx, @@ -488,6 +485,9 @@ def _configure_db_dw_create_params( arg_ctx.argument('elastic_pool_id', help='The name or resource id of the elastic pool to create the database in.') + arg_ctx.argument('storage_account_type', + arg_type=backup_storage_redundancy_param_type) + # *** Step 3: Ignore params that are not applicable (based on engine & create mode) *** # Only applicable to default create mode. Also only applicable to db. @@ -588,9 +588,6 @@ def load_arguments(self, _): with self.argument_context('sql db create') as c: _configure_db_dw_create_params(c, Engine.db, CreateMode.default) - c.argument('storage_account_type', - arg_type=backup_storage_redundancy_param_type) - c.argument('yes', options_list=['--yes', '-y'], help='Do not prompt for confirmation.', action='store_true') @@ -611,9 +608,6 @@ def load_arguments(self, _): help='Name of the server to create the copy in.' ' If unspecified, defaults to the origin server.') - c.argument('storage_account_type', - arg_type=backup_storage_redundancy_param_type) - with self.argument_context('sql db rename') as c: c.argument('new_name', help='The new name that the database will be renamed to.') @@ -642,9 +636,6 @@ def load_arguments(self, _): ' Either --time or --deleted-time (or both) must be specified. ' + time_format_help) - c.argument('storage_account_type', - arg_type=backup_storage_redundancy_param_type) - with self.argument_context('sql db show') as c: # Service tier advisors and transparent data encryption are not included in the first batch # of GA commands. @@ -824,9 +815,6 @@ def load_arguments(self, _): help='Name of the new replica.' ' If unspecified, defaults to the source database name.') - c.argument('storage_account_type', - arg_type=backup_storage_redundancy_param_type) - with self.argument_context('sql db replica set-primary') as c: c.argument('database_name', help='Name of the database to fail over.') diff --git a/src/azure-cli/azure/cli/command_modules/sql/custom.py b/src/azure-cli/azure/cli/command_modules/sql/custom.py index ead4ecaf495..92f8ea39a67 100644 --- a/src/azure-cli/azure/cli/command_modules/sql/custom.py +++ b/src/azure-cli/azure/cli/command_modules/sql/custom.py @@ -1429,6 +1429,11 @@ def db_update( if read_replica_count is not None: instance.read_replica_count = read_replica_count + # Set storage_account_type even if storage_acount_type is None + # Otherwise, empty value defaults to current storage_account_type + # and will potentially conflict with a previously requested update + instance.storage_account_type = storage_account_type + ##### # Set other (serverless related) properties #####