I'm trying to clone an Azure SQL Database using the PSCmdlet New-AzSqlDatabaseCopy (after being told that Restore-AzSqlDatabase won't let me do cross-server copies). My command is as follows:
New-AzSqlDatabaseCopy -ServerName $SourceDatabase.ServerName `
-ResourceGroupName $SourceDatabase.ResourceGroupName `
-DatabaseName $SourceDatabase.DatabaseName `
-ServiceObjectiveName $SourceDatabase.CurrentServiceObjectiveName `
-CopyServerName $TargetServerName `
-CopyResourceGroupName $TargetResourceGroupName `
-CopyDatabaseName $TargetDBName `
-ElasticPoolName $ElasticPoolName`
-ErrorAction stop
The source database is in a different server and resource group than the target, and in a different elastic pool than the target will be.
I've checked and double-checked all of my parameters to make sure they are correct, and I ran it with -whatif and everything looks good (except the creation date is 1/1/0001 but i'm not super concerned about that yet)
However, when I run the command, I get New-AzSqlDatabaseCopy : Long running operation failed with status 'Failed'. Additional Info:'The sku 'ElasticPool' specified is invalid.' Any input would be appreciated