Azure / azure-iot-cli-extension

Azure IoT extension for Azure CLI
Other
83 stars 65 forks source link

[feature] add tags option on az iot hub create command #277

Closed diogoscarvalho closed 3 years ago

diogoscarvalho commented 3 years ago

Describe the bug It is not a bug really but, in the organization where I'm currently working, there are some policies and rules to create a new resource in the Azure Portal. One of them is, you cannot create a resource without tagging it and, currently, it is not possible using Azure CLI

Expected behavior Be able to use tags option in the create command I.E az iot hub create --name "iot-az220-training-dsc201116" --resource-group "rg-az220-training-dsc201116" --sku S1 --partition-count 4 --location westeu --tags "Environmet:Developmet" "Subscription:S04"

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information): not applicable

Additional context Add any other context about the problem here.

digimaun commented 3 years ago

Hey @diogoscarvalho , thank you for this feature request. It is definitely well received and something on our radar. We've recently merged changes for supporting --tags in az dt and az iot dps, and we are driving towards the rest of our IoT services (like az iot hub) supporting --tags in a consistent way through the command line.

c-ryan-k commented 3 years ago

@diogoscarvalho - sorry this took so long, but this has been updated in the Azure CLI core version 2.18.0. https://github.com/Azure/azure-cli/releases/tag/azure-cli-2.18.0

https://docs.microsoft.com/en-us/cli/azure/iot/hub?view=azure-cli-latest#az_iot_hub_create

az iot hub create --resource-group MyResourceGroup --name MyIotHub --location westus --tags a=b c=d

Let us know if you run into any issues!