Conversation
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| sql db replica create | cmd sql db replica create added parameter partner_sub_id |
|
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 cross‐subscription GeoDR scenarios for SQL database replicas by introducing a new optional partner subscription id parameter. Key changes include:
- Updating test fixtures and adding a new cross‐subscription replica creation test with updated server locations.
- Modifying key functions in custom.py and _util.py to accept an optional subscription_id parameter.
- Adding a new CLI argument (partner_sub_id) in _params.py for specifying the partner subscription.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/latest/test_sql_commands.py | Updated test resource locations and added a cross‐subscription test case. |
| custom.py | Updated functions (_get_server_location, DatabaseIdentity, db_create_replica) to propagate subscription_id. |
| _util.py | Modified management client retrieval functions to accept subscription_id. |
| _params.py | Introduced partner_sub_id argument with corresponding help message. |
Comments suppressed due to low confidence (1)
src/azure-cli/azure/cli/command_modules/sql/_params.py:1138
- Concatenate the help string with an explicit space (e.g. after 'in.') to ensure the final message reads clearly.
help='Subscription id to create the new replica in.'
|
|
||
|
|
||
| def _get_server_location(cli_ctx, server_name, resource_group_name): | ||
| def _get_server_location(cli_ctx, server_name, resource_group_name, subscription_id = None): |
There was a problem hiding this comment.
[nitpick] Consider adding type hints for the new subscription_id parameter to improve code clarity and maintainability.
| def _get_server_location(cli_ctx, server_name, resource_group_name, subscription_id = None): | |
| def _get_server_location(cli_ctx, server_name: str, resource_group_name: str, subscription_id: Optional[str] = None) -> str: |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
@alecbain Pix fix the style error |
az sql db replica create : Add partner subscription id for cross-subscription GeoDraz sql db replica create: Add partner subscription id for cross-subscription GeoDr
|
@evelyn-ys Updated and fixed the style errors flagged by the pipeline. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Related command
az sql db replica create
Description
This change adds support for starting GeoDr in cross-subscription scenarios (secondary server in a different subscription than primary server). This is done by adding a new optional parameter for the partner subscription id, which when passed is used to create a management client using that subscription to call the create db workflow.
Testing Guide
Added automated test matching existing automated scenarios.
Manual test done with command like:
az sql db replica create -g <rgName> -s <serverName> -n <dbname> --partner-server <cross-sub_serverName> --partner-resource-group <partner_rgName> --partner-sub-id <partner_subscription_id>This 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.