I was trying to make a copy of a database on azure using powershell. I have used "Start-AzureSqlDatabaseCopy" for powershell as descriibed on https://msdn.microsoft.com/en-us/library/ff951631.aspx. But it was failing, and not able to create database copy there. I even tried deleting an existing database using "Remove-AzureSqlDatabase" and saw the same issue.
I have connected to the subscription successfully by using Import-AzurePublishSettingsFile. Verified the connection by providing invalid server and throws the expected exception.
Tried to execute as below
Start-AzureSqlDatabaseCopy -ServerName $SourceServerName -DatabaseName $SourceDatabaseName -PartnerServer $TargetServerName -PartnerDatabase $TargetDatabaseName
Throws the below exception.
Start-AzureSqlDatabaseCopy :https://management.core.windows.net/Id/services/sqlservers/servers/server/databases/database/databasecopies does not exist. Error Code: NotFound At s\Scripts\CreateCIDatabase.ps1:36 char:6 + Start-AzureSqlDatabaseCopy -ServerName $SourceServerName -DatabaseName $Sou ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-AzureSqlDatabaseCopy], CommunicationException + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.SqlDatabase.Database.Cmdlet.StartAzureSqlDatabaseCopy
I appreciate If someone can help me on this issue?
similar issue has also been posted https://stackguides.com/questions/29004974/azure-powershell-to-create-database-backup