[SQL] az sql mi link: Add multi-database link support - #33874
Open
Ivan (ivankostic85) wants to merge 4 commits into
Open
[SQL] az sql mi link: Add multi-database link support#33874Ivan (ivankostic85) wants to merge 4 commits into
az sql mi link: Add multi-database link support#33874Ivan (ivankostic85) wants to merge 4 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3ed3549e-3089-4b9a-91ca-ed7fff5a8e6d
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested a review
from Yong Zhang (yonzhan)
August 11, 2026 14:19
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the az sql mi link command set to use API version 2025-08-01-preview and introduces multi-database link capabilities (create via --link-mode, update membership via --databases), along with scenario coverage and refreshed recordings.
Changes:
- Bump
sql mi linkAAZ command implementations to2025-08-01-previewand surfacelinkModein outputs. - Add
--link-modetoaz sql mi link createand add--databasessupport toaz sql mi link updatefor multi-database links. - Add/refresh scenario tests + recordings for multi-database link management and error handling.
Reviewed changes
Copilot reviewed 10 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py | Adds multi-database MI link scenario tests and updates existing MI link checks to validate linkMode. |
| src/azure-cli/azure/cli/command_modules/sql/tests/latest/recordings/test_sql_mi_multi_database_link_mgmt.yaml | New recording covering multi-database link create/show/list/delete flows. |
| src/azure-cli/azure/cli/command_modules/sql/tests/latest/recordings/test_sql_mi_multi_database_link_error_handling.yaml | New recording covering multi-database validation/error cases (invalid link mode usage, name rules, update requirements). |
| src/azure-cli/azure/cli/command_modules/sql/aaz/latest/sql/mi/link/_create.py | Updates API version and adds --link-mode; returns linkMode from create. |
| src/azure-cli/azure/cli/command_modules/sql/aaz/latest/sql/mi/link/_update.py | Updates API version; adds --databases and returns linkMode from update. |
| src/azure-cli/azure/cli/command_modules/sql/aaz/latest/sql/mi/link/_show.py | Updates API version and returns linkMode from show. |
| src/azure-cli/azure/cli/command_modules/sql/aaz/latest/sql/mi/link/_list.py | Updates API version and returns linkMode from list. |
| src/azure-cli/azure/cli/command_modules/sql/aaz/latest/sql/mi/link/_failover.py | Updates API version and returns linkMode from failover. |
| src/azure-cli/azure/cli/command_modules/sql/aaz/latest/sql/mi/link/_delete.py | Updates API version for delete. |
Suppressed comments (2)
src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py:8800
.get_output_in_jsonis referenced but never called, so this line evaluates to a bound method object. Call it (or remove it) for consistency with the other scenario assertions.
self.cmd('sql mi link list -g {rg} --instance-name {mi_name}',
checks=[JMESPathCheck('length(@)', 0)]).get_output_in_json
src/azure-cli/azure/cli/command_modules/sql/tests/latest/test_sql_commands.py:8897
.get_output_in_jsonis referenced but never called, so this line evaluates to a bound method object. Call it (or remove it) for consistency with the other scenario assertions.
self.cmd('sql mi link list -g {rg} --instance-name {mi_name}',
checks=[JMESPathCheck('length(@)', 0)]).get_output_in_json
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+8691
to
+8694
| link_id = link['id'] | ||
| self.kwargs.update({ | ||
| 'link_id': link_id + '/distributedAvailabilityGroups/' + link_name | ||
| }) |
Comment on lines
+8717
to
+8718
| self.cmd('sql mi link list -g {rg} --instance-name {mi_name}', | ||
| checks=[JMESPathCheck('length(@)', 0)]).get_output_in_json |
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
az sql mi link: Add multi-database link support
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Collaborator
|
SQL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 PR Validation —⚠️ Review suggested
Related command
az sql mi link createaz sql mi link updateaz sql mi link showaz sql mi link listaz sql mi link failoveraz sql mi link deleteDescription
This PR adds multi-database Managed Instance link support using API version
2025-08-01-preview.Changes include:
az sql mi linkcommands to API version2025-08-01-preview.--link-modetoaz sql mi link create, supportingSingleDatabaseandMultiDatabase.--databasestoaz sql mi link updatefor updating database membership on multi-database links.linkModefrom create, update, show, list, and failover commands.Testing Guide
Run the recorded Managed Instance link tests:
azdev test test_sql_mi_link test_sql_mi_multi_database_link --seriesThe following validation checks were also run successfully:
azdev style --repo . --src HEAD --tgt <merge-base>azdev linter --ci-exclusions --min-severity medium --repo . --src HEAD --tgt <merge-base>azdev latest-index verify --repo .History Notes
[SQL]
az sql mi link create: Add multi-database link mode support[SQL]
az sql mi link update: Add database membership updates for multi-database linksThis 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.