azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

New-AzureRmSqlDatabase -Tags parameter does not work

Open TomRay74 opened this issue 10 years ago • 2 comments

I've tried to use the -Tags parameter with New-AzureRmSqlDatabase but it does not seem to store the tags in Azure.

Also, the type required for -Tags is System.Collections.Generic.Dictionary[string,string] which differs from -Tags used in for example New-AzureRmResourceGroup which is System.Collections.ArrayList.

The same type difference also exists with New-AzureRmSqlServer.

This is how I've created my $tags:

    $tags = New-Object "System.Collections.Generic.Dictionary[string,string]"
    $tags.Add("Company", "Company name")
    $tags.Add("Service", "Service name")

No error is returned, but the tags are not stored in Azure.

TomRay74 avatar Feb 10 '16 13:02 TomRay74

SQL Team: The guidance is to use Hashtable for tags - also, you should create the tags if they do not exist.

@treierts thanks for the report. Have you tried creating the tag first using New-AzureRmTag and then using the tag in your cmdlets?

markcowl avatar Feb 12 '16 21:02 markcowl

Fixed Tags overall in #3206.

jamestao avatar Nov 17 '16 20:11 jamestao