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
18 changes: 3 additions & 15 deletions src/azure-cli/azure/cli/command_modules/sql/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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')
Expand All @@ -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.')
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.')
Expand Down
5 changes: 5 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 @@ -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
#####
Expand Down