Skip to content

[SQL] az sql server create: Add --tags parameter to supply tags#31983

Merged
a0x1ab merged 15 commits intoAzure:devfrom
a0x1ab:dev
Aug 27, 2025
Merged

[SQL] az sql server create: Add --tags parameter to supply tags#31983
a0x1ab merged 15 commits intoAzure:devfrom
a0x1ab:dev

Conversation

@a0x1ab
Copy link
Copy Markdown
Member

@a0x1ab a0x1ab commented Aug 22, 2025

Related command
sql

Description

Testing Guide

  • Can be tested using az sql server create -g 'rg' --name 'test' --tags env=test purpose=demo
  • Added new test and recording to assess this functionality

This checklist is used to make sure that common guidelines for a pull request are followed.

a0x1ab added 12 commits July 29, 2025 22:45
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.
@a0x1ab a0x1ab added this to the September 2025 (2025-09-02) milestone Aug 22, 2025
@a0x1ab a0x1ab self-assigned this Aug 22, 2025
Copilot AI review requested due to automatic review settings August 22, 2025 04:30
@a0x1ab a0x1ab added the SQL az sql label Aug 22, 2025
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Aug 22, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @a0x1ab,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented Aug 22, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️sql
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd sql server create cmd sql server create added parameter tags

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Aug 22, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --tags parameter to the az sql server create command
  • 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.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Auto-Assign Auto assign by bot label Aug 22, 2025
@a0x1ab a0x1ab changed the title [SQL] az sql server create : Add parameter to supply tags [SQL] az sql server create:Add parameter to supply tags Aug 22, 2025
@a0x1ab a0x1ab changed the title [SQL] az sql server create:Add parameter to supply tags [SQL] az sql server create: Add parameter to supply tags Aug 22, 2025
calvinhzy
calvinhzy previously approved these changes Aug 22, 2025
@calvinhzy calvinhzy changed the title [SQL] az sql server create: Add parameter to supply tags [SQL] az sql server create: Add --tags parameter to supply tags Aug 22, 2025
@evelyn-ys
Copy link
Copy Markdown
Member

PR looks good to me. But better to have someone from sql team to review since this is service team owned module

Copy link
Copy Markdown
Contributor

@lixiachena lixiachena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@a0x1ab a0x1ab requested review from calvinhzy and lixiachena August 26, 2025 08:22
@a0x1ab a0x1ab merged commit 8ffe3d1 into Azure:dev Aug 27, 2025
48 checks passed
@a0x1ab a0x1ab linked an issue Aug 27, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot SQL az sql

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing --tags argument on az sql server create

6 participants