-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-AzureRMSqlDatabase how to rename a database #3571
Comments
@akromm Hey Adam, would you mind taking a look at this issue? |
@eriksteinebach Unfortunately we do not yet support renaming databases via ARM. Work to enable this is in progress but I do not have an ETA at the moment. |
Hi guys, any update on this as I want to use the ARM version of rename as well. |
@yatesy Unfortunately the work is still in progress. There are a number of back-end changes that we are working on to enable this. As a temporary work around you will need to use TSQL. |
I also had to apply the work around. Beside that will it also be possible to check if a database exists without listing all databases? |
@rfcdejong Through powershell you can use the -DatabaseName parameter in the Get-AzureRmSqlDatabase cmdlet. In TSQL I believe you should be able to use a WHERE clause to filter. |
Haha yes ofcourse, but would be nice to use the generated SqlManagementClient in C# .NET instead of using a release environment definition to pass a variable with the master password into the application during release. |
Any estimate on when will the commandlets be updated for this? Looking for a Set-AzureRMSqlDatabase, similar to the old Set-AzureSqlDatabase that let's you change the name of the database. |
It will be in the next release. #5009 |
This has been resolved. |
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.
|
Thanks for the feedback! Since your comment is azure-sdk-for-net, I have opened an issue over there and I am investigating how to fix this. |
@rfcdejong the change has been merged into Microsoft.Azure.Management.Sql and will be in the next release (1.13). Thanks again! |
Cmdlet(s)
Get-AzureSqlDatabase
Get-AzureRMSqlDatabase
PowerShell Version
5.1.14986.1000
OS Version
10.0.14986.1000
Description
Get-AzureSqlDatabase contains an argument -NewDatabaseName to rename a database. I am looking for a way to do the same with the Get-AzureRMSqlDatabase command (or any other command within the AzureRM powershell commands). But I cannot find a way to do it? I must be missing something, but I have been googling for 2 hours and I can't find any example.
I want to do this:
Set-AzureSqlDatabase -ServerName $ServerName -DatabaseName $DatabaseName -NewDatabaseName $NewDatabaseName
But than with AzureRM commands, something like:
Get-AzureRMSqlDatabase -ResourceGroupName $ResourceGroupName -ServerName $SeverName -DatabaseName $DatabaseName -????
Edit: Just to clarify, I understand there are other ways to change the database name via powershell, but I can not imagine there is no way in the AzureRM commands. I want to keep my scripts as clean as possible
The text was updated successfully, but these errors were encountered: