Error copying SQL database within Elastic Pool
See original GitHub issueFrom @martijnkamphuis on September 12, 2017 11:24
First, let me sketch my situation (resource type - resource name). All resources are in one resource group:
-
SQL server - sql_server_A — Elastic Pool - elastic_pool_1 ----- database - template_db
-
SQL server - sql_server_B (no elastic pools or existing databases)
-
SQL server - sql_server_C — Elastic Pool - elastic_pool_2
-
SQL server - sql_server_D — Elastic Pool - elastic_pool_1 (name equal to Elastic Pool from sql_server_A)
Code being used:
ISqlDatabase template_db = /* Template database obtained from source server */;
ISqlServer sqlTargetServer = /* SQL server instance obtained */;
var dbDefinition = sqlTargetServer.Databases.Define("db_from_template");
var db = await dbDefinition.WithSourceDatabase(template_db)
.WithMode(CreateMode.Copy)
.CreateAsync();
I am trying to copy my ‘template_db’ from ‘sql_server_A’ to any of the other SQL servers. What works is copying either to the same SQL server (sql_server_A), or to a different SQL server containing an Elastic Pool with the name equal to the one where the template database is linked to (sql_server_D, elastic_pool_1).
In the other cases (copy to sql_server_B or sql_server_C), an exception is thrown:
{"Long running operation failed with status 'Failed'."}
at Microsoft.Rest.Azure.AzureClientExtensions.<GetLongRunningOperationResultAsync>d__1`2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Rest.Azure.AzureClientExtensions.<GetLongRunningOperationResultAsync>d__0`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Rest.Azure.AzureClientExtensions.<GetPutOrPatchOperationResultAsync>d__4`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.Sql.Fluent.DatabasesOperations.<CreateOrUpdateWithHttpMessagesAsync>d__13.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.Sql.Fluent.DatabasesOperationsExtensions.<CreateOrUpdateAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.Sql.Fluent.SqlDatabaseImpl.<CreateChildResourceAsync>d__87.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.ResourceManager.Fluent.Core.IndependentChildImpl`7.<CreateResourceAsync>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.Creatable`4.<Microsoft-Azure-Management-ResourceManager-Fluent-Core-ResourceActions-IResourceCreator<IResourceT>-CreateResourceAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.CreatorTaskItem`1.<ExecuteAsync>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.TaskGroupBase`1.<ExecuteNodeTaskAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at Test.AzureService.<CopyDatabase>d__9.MoveNext() in C:\xxx\Test\AzureService.cs:line 132
In the Azure portal, it is possible to copy the database to a target server AND configure the Elastic Pool or DatabaseEdition/pricing tier. These options are not available in the Fluent SDK when using .WithSourceDatabase and/or .WithMode. I believe this should be added.
Copied from original issue: Azure/azure-sdk-for-net#3684
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top GitHub Comments
Hi,
Using v1.8, I still get this error:
This is the code I’ve used:
The source database is in an elasticpool named prodpool1, the target is named migrationpool. The source pool is a standard pool, the target is a premiumRS pool.
Thanks!
closed as dupe of #244