-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Description
Originally posted at Azure/azure-powershell#3571 (comment):
I have it working using the Microsoft.Azure.Management.Sql 1.11.0-preview NuGet package, but it is kinda difficult to call, why isn't it simply a parameter with newName?
This is my code what I have to write now with the new function.
It seems to require a ResourceMoveDefinition.
public async Task RenameAsync(string resourceGroupName, string serverName, string databaseName, string newName)
{
EnsureManagementClients();
var newDefinition = new ResourceMoveDefinition
{
Id = $"/subscriptions/{_sqlMgmtClient.SubscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{newName}"
};
await _sqlMgmtClient.Databases.RenameAsync(resourceGroupName, serverName, databaseName, newDefinition);
}
Metadata
Metadata
Assignees
Labels
No labels