Azure-cli: [Resource] 'az resource tag' fails when tagging Container Instances

Created on 15 Feb 2019  路  5Comments  路  Source: Azure/azure-cli

Describe the bug
Azure Container Instances can't be tagged through usage of Azure Cli.

az container create doesn't allow --tags and az resource tag fails with the following error: The password in the 'imageRegistryCredentials' of container group 'MyContainerInstance' cannot be empty.

az resource tag --tags environment=Development --id $resourceID
The password in the 'imageRegistryCredentials' of container group 'MyContainerInstance' cannot be empty.

To Reproduce
Run az resource tag --tags environment=Development --id $resourceID

Expected behavior
Container group is tagged
Environment summary
Installed CLI via MSI and also apt-get
Problem occurs on both PowerShell and WSL bash
CLI version azure-cli (2.0.58)

Container Instances Service Attention bug customer-reported

Most helpful comment

Any workaround using Azure CLI?

All 5 comments

I ran into the same issue.
If you're using one of the SDKs, you can do this yourself using the Container Groups - Update API.

For example in C#

await azure.ContainerGroups.Inner.UpdateAsync("myResourceGroup", "myContainerGroupName", new ResourceInner { Tags =  newTags });

Or in Python:

update(resource_group_name, container_group_name, tags=my_tags)

https://docs.microsoft.com/en-us/python/api/azure-mgmt-containerinstance/azure.mgmt.containerinstance.operations.container_groups_operations.containergroupsoperations?view=azure-python#update-resource-group-name--container-group-name--location-none--tags-none--custom-headers-none--raw-false----operation-config-

Hopefully an az container update command can be added in the future to support this in the CLI!

Any workaround using Azure CLI?

Isn't creating a resource in Azure(or any public cloud) with tags kind of a table stakes item for deploying a new product at Microsoft?

Maybe someone can start looking at this again. Been a year.

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dkkapur.

Was this page helpful?
0 / 5 - 0 ratings