Skip to content
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

Fail to add tags to network resources (application-gateway) #5936

Closed
sshepel opened this issue Mar 27, 2018 · 2 comments · Fixed by #5943
Closed

Fail to add tags to network resources (application-gateway) #5936

sshepel opened this issue Mar 27, 2018 · 2 comments · Fixed by #5943
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Network az network vnet/lb/nic/dns/etc...
Milestone

Comments

@sshepel
Copy link

sshepel commented Mar 27, 2018


Environment summary

Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)

apt / 2.0.29 / Ubuntu 16.04 / bash

When I'm trying to add tag to application-gateway resource with following command:

az network application-gateway create <some arguments> --tags env=dev costCenter=development

I'm getting following error:

Deployment template parse failed: 'Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'Microsoft.WindowsAzure.ResourceStack.Frontdoor.Data.Entities.Tags.TagsDictionary' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.
To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.
Path ''.'.

JSON template snippet from the debug output:

"resources": [{
                .....
                "tags": ["env=dev", "costCenter=development"],
                .....
@tjprescott tjprescott added bug This issue requires a change to an existing behavior in the product in order to be resolved. Network az network vnet/lb/nic/dns/etc... labels Mar 28, 2018
@tjprescott
Copy link
Member

Thank you for the report @sshepel. We'll get a fix into the next release. As a workaround, you can create the application gateway and then use the update command to add the tags:

az network application-gateway create -g <rg> -n <name> ... --no-wait
az network application-gateway wait -g <rg> -n <name> --exists
az network application-gateway update -g <rg> -n <name> --tags <key=val> <key=val>

@sshepel
Copy link
Author

sshepel commented Mar 28, 2018

Thanks a lot for taking care of this @tjprescott and for workaround also ;)

tjprescott added a commit that referenced this issue Mar 28, 2018
@haroldrandom haroldrandom added bug This issue requires a change to an existing behavior in the product in order to be resolved. Network az network vnet/lb/nic/dns/etc... labels Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Network az network vnet/lb/nic/dns/etc...
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants