Sample Header Ad - 728x90

Restoring a managed SQL instance in Azure using PowerShell

0 votes
1 answer
798 views
I am trying to figure out how to restore a database from one managed SQL instance to another. I'm following the tutorials, but I keep running into inscrutable error messages. Here's my command:
Restore-AzSqlInstanceDatabase `
    -Name "SomeDatabase" `
    -InstanceName "our-oltp-dev" `
    -ResourceGroupName "dev-managedsqlinstances" `
    -PointInTime "4/7/2020 12:00:00" `
    -TargetInstanceDatabaseName "SomeDatabase_FROM_DEV" `
    -TargetInstanceName "our-oltp-sandbox" `
    -TargetResourceGroupName "sandbox-managedsqlinstances"
Here's the output:
PS C:\WINDOWS\system32> Restore-AzSqlInstanceDatabase `
    -Name "SomeDatabase" `
    -InstanceName "our-oltp-dev" `
    -ResourceGroupName "dev-managedsqlinstances" `
    -PointInTime "4/7/2020 12:00:00" `
    -TargetInstanceDatabaseName "SomeDatabase_FROM_DEV" `
    -TargetInstanceName "our-oltp-sandbox" `
    -TargetResourceGroupName "sandbox-managedsqlinstances"
Restore-AzSqlInstanceDatabase : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Restore-AzSqlInstanceDatabase `
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Restore-AzSqlInstanceDatabase], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Azure.Commands.Sql.ManagedDatabase.Cmdlet.RestoreAzureRmSqlManagedDatabase
It's a copy-and-paste from the Azure docs; so I'm not sure what I'm doing wrong. Any help would be appreciated.
Asked by eckza (101 rep)
Apr 7, 2020, 09:25 PM
Last activity: Apr 19, 2025, 03:02 PM