[SQL] az sql server create: Add --tags parameter to supply tags#31983
[SQL] az sql server create: Add --tags parameter to supply tags#31983
az sql server create: Add --tags parameter to supply tags#31983Conversation
Update template spec operations to extract and use the subscription ID from the resource ID if provided. Add tests to verify correct handling of subscription IDs in show, update, delete, and export commands for template specs.
Deleted test cases and YAML recordings related to template spec operations using a fake subscription ID. These tests were unnecessary as the functionality is already tested in other tests.
Removed redundant subscription_id variable assignments in template spec-related functions. Now, subscription_id is passed directly from parsed resource ID when template_spec is provided, improving code clarity and reducing duplication.
Introduces new test cases to validate update, show, delete and export operations for template specs using an auxiliary subscription.
Introduces the 'tags' argument to SQL server creation commands in _params.py. Adds a new test and recording to verify server creation with tags in test_sql_commands.py and corresponding YAML recording.
️✔️AzureCLI-FullTest
|
|
Hi @a0x1ab, |
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| sql server create | cmd sql server create added parameter tags |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for specifying tags when creating SQL servers using the az sql server create command. It resolves a feature request to allow users to apply metadata tags during SQL server creation, making it consistent with other Azure resource creation commands.
- Adds the
--tagsparameter to theaz sql server createcommand - Implements proper test coverage to verify tag functionality works correctly
- Creates test recordings to ensure the feature operates as expected
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/sql/_params.py |
Adds tags parameter to the server creation command configuration |
src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py |
Adds comprehensive test case to verify tags functionality during server creation and retrieval |
src/azure-cli/azure/cli/command_modules/sql/tests/latest/recordings/test_sql_server_create_with_tags.yaml |
Test recording file capturing the HTTP interactions for the new tags functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
az sql server create : Add parameter to supply tagsaz sql server create:Add parameter to supply tags
az sql server create:Add parameter to supply tagsaz sql server create: Add parameter to supply tags
az sql server create: Add parameter to supply tagsaz sql server create: Add --tags parameter to supply tags
|
PR looks good to me. But better to have someone from sql team to review since this is service team owned module |
lixiachena
left a comment
There was a problem hiding this comment.
update _help.py to add this parameter as well
Added a new usage example to the SQL server create command help, demonstrating how to specify tags during server creation.
Related command
sql
Description
az sql server createcommandTesting Guide
az sql server create -g 'rg' --name 'test' --tags env=test purpose=demoThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.