Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.87k forks source link

Add support for creating cross-subscription Geo-replicated databases #26598

Closed alecbain closed 2 weeks ago

alecbain commented 2 weeks ago

Description

This changeset adds an optional parameter to the New-AzSqlDatabaseSecondary cmdlet to allow creating a geo-secondary database on a server in a different subscription id.

If the optional PartnerSubscriptionId parameter is passed, it will attempt to start the database copy on the server specified using that subscription id. The user making the call will still need proper permissions on the second subscription, which are validated and checked in the backend API.

Mandatory Checklist

azure-client-tools-bot-prd[bot] commented 2 weeks ago
️✔️Az.Accounts >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
️✔️Az.Compute >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
️✔️Az.EventHub >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
️✔️Az.KeyVault >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
️✔️Az.ManagedServiceIdentity >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
️✔️Az.Monitor >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
️✔️Az.Network >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ️✔️Test > >>
>> ️✔️ - Linux >> >> >>
>>
>> ️✔️ - MacOS >> >> >>
>>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
️✔️Az.OperationalInsights >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
️✔️Az.PrivateDns >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
⚠️Az.Sql >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ️✔️Breaking Change Check > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ️✔️Signature Check > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ⚠️Help Example Check > >>
>> ⚠️PowerShell Core - Windows >> >>|Type|Cmdlet|Example|Line|RuleName|Description|Extent|Remediation| >>|---|---|---|---|---|---|---|---| >>|⚠️|New-AzSqlDatabaseSecondary|1|1|Unassigned_Variable|Get-AzSqlDatabase -DatabaseName $databasename is a null-valued parameter value.|-DatabaseName|Assign value for $databasename.| >>|⚠️|New-AzSqlDatabaseSecondary|1|1|Unassigned_Variable|Get-AzSqlDatabase -ResourceGroupName $primaryresourcegroupname is a null-valued parameter value.|-ResourceGroupName|Assign value for $primaryresourcegroupname.| >>|⚠️|New-AzSqlDatabaseSecondary|1|1|Unassigned_Variable|Get-AzSqlDatabase -ServerName $primaryservername is a null-valued parameter value.|-ServerName|Assign value for $primaryservername.| >>|⚠️|New-AzSqlDatabaseSecondary|1|2|Unassigned_Variable|New-AzSqlDatabaseSecondary -PartnerResourceGroupName $secondaryresourcegroupname is a null-valued parameter value.|-PartnerResourceGroupName|Assign value for $secondaryresourcegroupname.| >>|⚠️|New-AzSqlDatabaseSecondary|1|2|Unassigned_Variable|New-AzSqlDatabaseSecondary -PartnerServerName $secondaryservername is a null-valued parameter value.|-PartnerServerName|Assign value for $secondaryservername.| >>|⚠️|New-AzSqlDatabaseSecondary|2|1|Unassigned_Variable|Get-AzSqlDatabase -DatabaseName $databasename is a null-valued parameter value.|-DatabaseName|Assign value for $databasename.| >>|⚠️|New-AzSqlDatabaseSecondary|2|1|Unassigned_Variable|Get-AzSqlDatabase -ResourceGroupName $primaryresourcegroupname is a null-valued parameter value.|-ResourceGroupName|Assign value for $primaryresourcegroupname.| >>|⚠️|New-AzSqlDatabaseSecondary|2|1|Unassigned_Variable|Get-AzSqlDatabase -ServerName $primaryservername is a null-valued parameter value.|-ServerName|Assign value for $primaryservername.| >>|⚠️|New-AzSqlDatabaseSecondary|2|2|Unassigned_Variable|New-AzSqlDatabaseSecondary -PartnerResourceGroupName $secondaryresourcegroupname is a null-valued parameter value.|-PartnerResourceGroupName|Assign value for $secondaryresourcegroupname.| >>|⚠️|New-AzSqlDatabaseSecondary|2|2|Unassigned_Variable|New-AzSqlDatabaseSecondary -PartnerServerName $secondaryservername is a null-valued parameter value.|-PartnerServerName|Assign value for $secondaryservername.| >>|⚠️|New-AzSqlDatabaseSecondary|2|2|Unassigned_Variable|New-AzSqlDatabaseSecondary -PartnerDatabaseName $secondarydatabasename is a null-valued parameter value.|-PartnerDatabaseName|Assign value for $secondarydatabasename.| >> >>
>>
>> ⚠️Windows PowerShell - Windows >> >>|Type|Cmdlet|Example|Line|RuleName|Description|Extent|Remediation| >>|---|---|---|---|---|---|---|---| >>|⚠️|New-AzSqlDatabaseSecondary|1|1|Unassigned_Variable|Get-AzSqlDatabase -DatabaseName $databasename is a null-valued parameter value.|-DatabaseName|Assign value for $databasename.| >>|⚠️|New-AzSqlDatabaseSecondary|1|1|Unassigned_Variable|Get-AzSqlDatabase -ResourceGroupName $primaryresourcegroupname is a null-valued parameter value.|-ResourceGroupName|Assign value for $primaryresourcegroupname.| >>|⚠️|New-AzSqlDatabaseSecondary|1|1|Unassigned_Variable|Get-AzSqlDatabase -ServerName $primaryservername is a null-valued parameter value.|-ServerName|Assign value for $primaryservername.| >>|⚠️|New-AzSqlDatabaseSecondary|1|2|Unassigned_Variable|New-AzSqlDatabaseSecondary -PartnerResourceGroupName $secondaryresourcegroupname is a null-valued parameter value.|-PartnerResourceGroupName|Assign value for $secondaryresourcegroupname.| >>|⚠️|New-AzSqlDatabaseSecondary|1|2|Unassigned_Variable|New-AzSqlDatabaseSecondary -PartnerServerName $secondaryservername is a null-valued parameter value.|-PartnerServerName|Assign value for $secondaryservername.| >>|⚠️|New-AzSqlDatabaseSecondary|2|1|Unassigned_Variable|Get-AzSqlDatabase -DatabaseName $databasename is a null-valued parameter value.|-DatabaseName|Assign value for $databasename.| >>|⚠️|New-AzSqlDatabaseSecondary|2|1|Unassigned_Variable|Get-AzSqlDatabase -ResourceGroupName $primaryresourcegroupname is a null-valued parameter value.|-ResourceGroupName|Assign value for $primaryresourcegroupname.| >>|⚠️|New-AzSqlDatabaseSecondary|2|1|Unassigned_Variable|Get-AzSqlDatabase -ServerName $primaryservername is a null-valued parameter value.|-ServerName|Assign value for $primaryservername.| >>|⚠️|New-AzSqlDatabaseSecondary|2|2|Unassigned_Variable|New-AzSqlDatabaseSecondary -PartnerResourceGroupName $secondaryresourcegroupname is a null-valued parameter value.|-PartnerResourceGroupName|Assign value for $secondaryresourcegroupname.| >>|⚠️|New-AzSqlDatabaseSecondary|2|2|Unassigned_Variable|New-AzSqlDatabaseSecondary -PartnerServerName $secondaryservername is a null-valued parameter value.|-PartnerServerName|Assign value for $secondaryservername.| >>|⚠️|New-AzSqlDatabaseSecondary|2|2|Unassigned_Variable|New-AzSqlDatabaseSecondary -PartnerDatabaseName $secondarydatabasename is a null-valued parameter value.|-PartnerDatabaseName|Assign value for $secondarydatabasename.| >> >>
>
>
> ️✔️Help File Existence Check > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ️✔️File Change Check > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ️✔️UX Metadata Check > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
>
> ⚠️Test > >>
>> ⚠️ - Linux >> >>|Type|Title|Current Coverage|Last Coverage|Description| >>|---|---|---|---|---| >>|⚠️|Test Coverage Less Than 80%|62.15 %|62.22%|Test coverage cannot be lower than the number of the last release.| >> >>
>>
>> ⚠️ - MacOS >> >>|Type|Title|Current Coverage|Last Coverage|Description| >>|---|---|---|---|---| >>|⚠️|Test Coverage Less Than 80%|62.15%|62.22%|Test coverage cannot be lower than the number of the last release.| >> >>
>>
>> ⚠️PowerShell Core - Windows >> >>|Type|Title|Current Coverage|Last Coverage|Description| >>|---|---|---|---|---| >>|⚠️|Test Coverage Less Than 80%|62.15%|62.22%|Test coverage cannot be lower than the number of the last release.| >> >>
>>
>> ⚠️Windows PowerShell - Windows >> >>|Type|Title|Current Coverage|Last Coverage|Description| >>|---|---|---|---|---| >>|⚠️|Test Coverage Less Than 80%|62.15%|62.22%|Test coverage cannot be lower than the number of the last release.| >> >>
>
️✔️Az.Storage >
> ️✔️Build > >>
>> ️✔️PowerShell Core - Windows >> >> >>
>>
>> ️✔️Windows PowerShell - Windows >> >> >>
>
vidai-msft commented 2 weeks ago

@alecbain Please update the help doc.

github-actions[bot] commented 2 weeks ago

This PR was labeled "needs-revision" because it has unresolved review comments or CI failures. Please resolve all open review comments and make sure all CI checks are green. Refer to our guide to troubleshoot common CI failures.

vidai-msft commented 2 weeks ago

/azp run

azure-pipelines[bot] commented 2 weeks ago
Azure Pipelines successfully started running 3 pipeline(s).
vidai-msft commented 2 weeks ago

/azp run azure-powershell - security-tools

azure-pipelines[bot] commented 2 weeks ago
Azure Pipelines successfully started running 1 pipeline(s).