diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/_params.py b/src/azure-cli/azure/cli/command_modules/rdbms/_params.py index d9112647344..25c5c5b7271 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/_params.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/_params.py @@ -267,8 +267,8 @@ def _flexible_server_params(command_group): id_part='child_name_1', help='The name of the database to be created when provisioning the database server. ' 'Database name must begin with a letter (a-z) or underscore (_). Subsequent characters ' - 'in a name can be letters, digits (0-9), or underscores. Database name length must be less ' - 'than 32 characters.', + 'in a name can be letters, digits (0-9), hyphens (-), or underscores. ' + 'Database name length must be less than 64 characters.', local_context_attribute=LocalContextAttribute( name='database_name', actions=[LocalContextAction.SET], diff --git a/src/azure-cli/azure/cli/command_modules/rdbms/validators.py b/src/azure-cli/azure/cli/command_modules/rdbms/validators.py index f8cdd5ed66b..11bb270e963 100644 --- a/src/azure-cli/azure/cli/command_modules/rdbms/validators.py +++ b/src/azure-cli/azure/cli/command_modules/rdbms/validators.py @@ -986,7 +986,7 @@ def validate_backup_name(backup_name): def validate_database_name(database_name): - if database_name is not None and not re.match(r'^[a-zA-Z_][a-zA-Z0-9_]{0,30}$', database_name): + if database_name is not None and not re.match(r'^[a-zA-Z_][\w\-]{0,62}$', database_name): raise ValidationError("Database name must begin with a letter (a-z) or underscore (_). " - "Subsequent characters in a name can be letters, digits (0-9), or underscores. " - "Database name length must be less than 32 characters.") + "Subsequent characters in a name can be letters, digits (0-9), hyphens (-), " + "or underscores. Database name length must be less than 64 characters.")