Reputation: 904
We had successfully been using New-AzureRmSqlDatabaseCopy in an Octopus Deploy step to copy our production database into a staging database. It recently stopped working with the following vague error:
New-AzureRmSqlDatabaseCopy : 40687: The operation cannot be performed on the database 'databaseMcDatabase' in its current state.
At C:\Octopus\Work\20170623140313-4142\Script.ps1:9 char:1
+ New-AzureRmSqlDatabaseCopy -CopyDatabaseName $DatabaseName -DatabaseName Source ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [New-AzureRmSqlDatabaseCopy], CloudException
+ FullyQualifiedErrorId : Hyak.Common.CloudException,Microsoft.Azure.Commands.Sql.Replication.Cmdlet.NewAzureSqlDatabaseCopy
Upvotes: 2
Views: 415
Reputation: 904
The issue ended up being insufficient space in our Azure Elastic Pool. I discovered I could copy a smaller database without any issue, and when I removed the -ElasticPoolName option from the command I was able to copy the 60GB db also.
Upvotes: 3