Skip to content

Comments

docs(backup): Add cross-subscription restore examples for SQL DB via PowerShell#2

Open
Copilot wants to merge 2 commits intomainfrom
copilot/add-cross-subscription-restore-example
Open

docs(backup): Add cross-subscription restore examples for SQL DB via PowerShell#2
Copilot wants to merge 2 commits intomainfrom
copilot/add-cross-subscription-restore-example

Conversation

Copy link

Copilot AI commented Feb 21, 2026

The PowerShell automation article for SQL DB backup/restore lacked any guidance on cross-subscription restore (CSR), leaving customers without a clear path for restoring to a target SQL VM in a different subscription.

Changes

  • New section: Cross subscription restores — added under the restore configuration heading, parallel to the existing secondary region restore section, covering:
    • How to switch subscriptions to fetch the target container and SQL instance registered to the source vault
    • Recovery config generation for restore as Database (full recovery point + log point-in-time)
    • Recovery config generation for restore as Files (full recovery point + log point-in-time)
    • Explicit Restore-AzRecoveryServicesBackupItem example noting that -RestoreToSecondaryRegion must not be used for CSR

Key pattern

# Switch to target subscription and fetch the cross-sub container/instance
Select-AzSubscription -SubscriptionId "<target subscription ID>"
$TargetContainer = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVMAppContainer -Status Registered -VaultId $testVault.ID -FriendlyName "<target VM name>"
$TargetSQLInstance = Get-AzRecoveryServicesBackupProtectableItem -WorkloadType MSSQL -ItemType SQLInstance -VaultId $testVault.ID -Container $TargetContainer

# Switch back to source subscription, then build the restore config
Select-AzSubscription -SubscriptionId "<source subscription ID>"
$AnotherSubWithFullConfig = Get-AzRecoveryServicesBackupWorkloadRecoveryConfig `
    -RecoveryPoint $FullRP -TargetItem $TargetSQLInstance `
    -AlternateWorkloadRestore -VaultId $testVault.ID -TargetContainer $TargetContainer

# Trigger restore — no -RestoreToSecondaryRegion for CSR
Restore-AzRecoveryServicesBackupItem -WLRecoveryConfig $AnotherSubWithFullConfig -VaultId $testVault.ID

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: amitgang <60372048+amitgang@users.noreply.github.com>
Copilot AI changed the title [WIP] Add examples for cross subscription restore of SQL database docs(backup): Add cross-subscription restore examples for SQL DB via PowerShell Feb 21, 2026
Copilot AI requested a review from amitgang February 21, 2026 12:44
@amitgang amitgang marked this pull request as ready for review February 21, 2026 12:49
@amitgang
Copy link
Owner

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.

2 participants