azure-powershell
azure-powershell copied to clipboard
Set-AzureRmSqlDatabase -Tags --> does not work, throws error
When issuing the cmdlet Set-AzureRmSqlDatabase -Tags an error is thrown. The cmdlet should accept the Tags hashtable received from Get-AzureRmResource cmdlet.
Steps to reproduce:
- Get AzureRm Resource
$resource = Get-AzureRmResource -ResourceId YOUR_SqlDatabase_ResourceId - Call Set-AzureRmSqlDatabase cmdlet to set Tags on database resource.
Set-AzureRmSqlDatabase -DatabaseName SqlDatabase Name `
-ServerName SqlDatabaseServer -ResourceGroupName ResourceGroupName `
-Tags $resource.Tags
- Following error is thrown
Set-AzureRmSqlDatabase : Cannot convert 'System.Collections.Generic.List`1[System.Collections.Hashtable]' to the type
'System.Collections.Generic.Dictionary`2[System.String,System.String]' required by parameter 'Tags'. Specified method
is not supported.
At line:1 char:106
+ ... erverName SqlDatabaseServer -ResourceGroupName ResourceGroupName -Tags $resource.Tags
+ ~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Set-AzureRmSqlDatabase], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgument,Microsoft.Azure.Commands.Sql.Database.Cmdlet.SetAzureSqlDatabase
@akromm can you take a look?
Fixed Tags overall in #3206