I am experiencing an intermittent issue with SQL Azure. I am copying a readonly SQL Azure database (V12) from one elastic pool into another. Once the database is copied, I set it to read/write using:
$"ALTER DATABASE [{databaseName}] SET READ_WRITE"
This sometimes fails with the error:
The operation cannot be performed on database *** because it is involved in a database mirroring session or an availability group
I have tried implementing retry logic with backoff but that doesn't work. I have failed to find any documentation relating to this error or to database mirroring in Azure.
Any advice would be greatly appreciated!