Skip to content

[Sql] Add multi-database Managed Instance Link support - #30019

Open
Ivan (ivankostic85) wants to merge 4 commits into
Azure:mainfrom
ivankostic85:ivankostic85/sql-mi-link-multi-database
Open

[Sql] Add multi-database Managed Instance Link support#30019
Ivan (ivankostic85) wants to merge 4 commits into
Azure:mainfrom
ivankostic85:ivankostic85/sql-mi-link-multi-database

Conversation

@ivankostic85

Copy link
Copy Markdown

Description

Adds multi-database support for Azure SQL Managed Instance Link.

  • Updated the Distributed Availability Groups API to 2025-08-01-preview.
  • Added -LinkMode to New-AzSqlInstanceLink, supporting SingleDatabase and MultiDatabase.
  • Added -Database to Update-AzSqlInstanceLink for updating multi-database link membership.
  • Added LinkMode to Managed Instance Link output objects.
  • Added multi-database lifecycle, database membership update, and validation test scenarios.
  • Refreshed all existing Managed Instance Link recordings for the new API version.
  • Updated cmdlet help and the Az.Sql changelog.

Validation

  • SQL CheckIn tests: 355 passed, 122 skipped, 0 failed.
  • Managed Instance Link playback tests: 9 passed, 0 failed.

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cb086ced-1eda-445d-b945-7fae0bad98cf
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cb086ced-1eda-445d-b945-7fae0bad98cf
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: cb086ced-1eda-445d-b945-7fae0bad98cf
Copilot AI lite review requested due to automatic review settings August 15, 2026 09:39
@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds multi-database support to the Az.Sql Managed Instance Link (Distributed Availability Groups) cmdlets by updating the underlying SQL RP API version and extending create/update surfaces to support multi-database link mode and database membership updates.

Changes:

  • Updated the SQL Managed Instance Distributed Availability Groups client to 2025-08-01-preview and regenerated related SDK models/operations.
  • Extended New-AzSqlInstanceLink with -LinkMode and extended Update-AzSqlInstanceLink with -Database for membership updates.
  • Added new live-only scenario tests and refreshed help + changelog entries for the new functionality.

Reviewed changes

Copilot reviewed 10 out of 41 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Sql/Sql/help/Update-AzSqlInstanceLink.md Documents optional replication mode and new -Database update capability.
src/Sql/Sql/help/New-AzSqlInstanceLink.md Documents new -LinkMode parameter and multi-database example.
src/Sql/Sql/DistributedAvailabilityGroup/Services/AzureSqlManagedInstanceLinkAdapter.cs Sends/reads LinkMode on create and Databases on update; surfaces LinkMode in outputs.
src/Sql/Sql/DistributedAvailabilityGroup/Model/AzureSqlManagedInstanceLinkModel.cs Adds LinkMode to the link model returned by cmdlets.
src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/UpdateAzureSqlManagedInstanceLink.cs Adds -Database and enforces “at least one property to update” semantics.
src/Sql/Sql/DistributedAvailabilityGroup/Cmdlet/NewAzureSqlManagedInstanceLink.cs Adds -LinkMode and passes it through to service create.
src/Sql/Sql/ChangeLog.md Adds Upcoming Release entry for multi-database link support.
src/Sql/Sql.Test/ScenarioTests/DistributedAvailabilityGroupTests.ps1 Adds multi-database lifecycle + membership update scenarios and helpers.
src/Sql/Sql.Test/ScenarioTests/DistributedAvailabilityGroupTests.cs Registers new live-only multi-database scenario tests.
src/Sql/Sql.Management.Sdk/README.md Updates swagger/spec commit reference and DAG spec path/version.
src/Sql/Sql.Management.Sdk/Generated/Models/SeedingModeType.cs Adds XML doc comments to generated constants.
src/Sql/Sql.Management.Sdk/Generated/Models/RoleChangeType.cs Adds XML doc comments to generated constants.
src/Sql/Sql.Management.Sdk/Generated/Models/ResourceAutoGenerated.cs Adds generated base resource model used by regenerated proxy resources.
src/Sql/Sql.Management.Sdk/Generated/Models/ReplicationModeType.cs Adds XML doc comments to generated constants.
src/Sql/Sql.Management.Sdk/Generated/Models/ReplicaSynchronizationHealth.cs Adds XML doc comments to generated constants.
src/Sql/Sql.Management.Sdk/Generated/Models/ReplicaConnectedState.cs Adds XML doc comments to generated constants.
src/Sql/Sql.Management.Sdk/Generated/Models/ProxyResourceAutoGenerated.cs Adds generated proxy-resource base class used by regenerated resources.
src/Sql/Sql.Management.Sdk/Generated/Models/LinkRole.cs Adds XML doc comments to generated constants.
src/Sql/Sql.Management.Sdk/Generated/Models/LinkModeType.cs Introduces LinkMode type constants (SingleDatabase, MultiDatabase).
src/Sql/Sql.Management.Sdk/Generated/Models/InstanceRole.cs Adds XML doc comments to generated constants.
src/Sql/Sql.Management.Sdk/Generated/Models/FailoverType.cs Adds XML doc comments to generated constants.
src/Sql/Sql.Management.Sdk/Generated/Models/FailoverModeType.cs Adds XML doc comments to generated constants.
src/Sql/Sql.Management.Sdk/Generated/Models/DistributedAvailabilityGroupsUpdateHeaders.cs Adds generated header model for Update LRO responses.
src/Sql/Sql.Management.Sdk/Generated/Models/DistributedAvailabilityGroupsSetRoleHeaders.cs Adds generated header model for SetRole LRO responses.
src/Sql/Sql.Management.Sdk/Generated/Models/DistributedAvailabilityGroupsFailoverHeaders.cs Extends failover headers to include Retry-After.
src/Sql/Sql.Management.Sdk/Generated/Models/DistributedAvailabilityGroupsDeleteHeaders.cs Adds generated header model for Delete LRO responses.
src/Sql/Sql.Management.Sdk/Generated/Models/DistributedAvailabilityGroupsCreateOrUpdateHeaders.cs Adds generated header model for CreateOrUpdate LRO responses.
src/Sql/Sql.Management.Sdk/Generated/Models/DistributedAvailabilityGroupProperties.cs Adds linkMode to DAG properties model.
src/Sql/Sql.Management.Sdk/Generated/Models/DistributedAvailabilityGroup.cs Adds LinkMode and updates base class to regenerated proxy resource.
src/Sql/Sql.Management.Sdk/Generated/IDistributedAvailabilityGroupsOperations.cs Updates operation signatures to include header models and correct method semantics.
src/Sql/Sql.Management.Sdk/Generated/DistributedAvailabilityGroupsOperationsExtensions.cs Updates extension methods to match regenerated operation signatures/return types.
src/Sql/Sql.Management.Sdk/Generated/DistributedAvailabilityGroupsOperations.cs Updates REST implementation for new API version and revised Update/Delete/headers behavior.
Suppressed comments (1)

src/Sql/Sql/help/Update-AzSqlInstanceLink.md:337

  • The help metadata for -ReplicationMode says Parameter Sets: (All) but also hard-codes Position: 3. In code, -ReplicationMode is positional 1 in the InputObject/ResourceId parameter sets, so the documented position is incorrect and can confuse users.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Sql/Sql/help/New-AzSqlInstanceLink.md Outdated
@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 15, 2026 12:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 41 changed files in this pull request and generated no new comments.

Suppressed comments (2)

src/Sql/Sql.Test/ScenarioTests/DistributedAvailabilityGroupTests.ps1:661

  • The test expects an error message that does not match the cmdlet’s actual PSArgumentException text (the cmdlet includes parameter-style names with leading dashes). This will cause Assert-ThrowsContains to fail even when the cmdlet correctly throws.
        # An update must specify replication mode or database membership
        $missingUpdatePropertyMessage = "At least one of ReplicationMode or Database must be specified."
        Assert-ThrowsContains { Update-AzSqlInstanceLink -ResourceGroupName $rgName -InstanceName $miName -Name $linkName } $missingUpdatePropertyMessage

src/Sql/Sql/help/Update-AzSqlInstanceLink.md:207

  • The example heading says “Remove a database…”, but the cmdlet parameter semantics here are “replace the membership list” (as the following description correctly explains). Updating the heading to reflect that replacement semantics will avoid confusion for users.

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
Successfully started running 3 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants