英文:
Why can't a SQL Server be tagged during the creation in Azure CLI?
问题
根据az sql server create文档中的信息,似乎无法指定标签。我可以确认这一点,因为运行以下命令成功:
az sql server create --resource-group groupy `
--name sql-sqlserver-v12 `
--admin-user hakuna --admin-password matata
但是运行以下命令失败:
az sql server create --resource-group groupy --name sql-sqlserver-v12 `
--admin-user hakuna --admin-password matata `
--tags some=thing
这让我感到困惑,因为通常在创建过程中可以为其他资源添加标签。此外,返回的JSON中有一个名为tags的字段(目前为空)。我还看到GUI中有一个用于添加标签的位置。
这种语法不一致(对我来说)的原因是什么?是否有不为服务器添加标签的理由?如果有,是什么原因?如果没有,如何按照最佳实践为其添加标签?
英文:
According to the docs for az sql server create
, there's no way to specify the tags. I can also confirm it because running
az sql server create --resource-group groupy `
--name sql-sqlserver-v12 `
--admin-user hakuna --admin-password matata
works, while
az sql server create --resource-group groupy --name sql-sqlserver-v12 `
--admin-user hakuna --admin-password matata `
--tags some=thing
fails. It confuses me because it's generally possible to tag up other things during hte creation. Also, there's a field in the returned JSON called tags (being empty now). I also see that the GUI has a way spot to add tags.
What is the reason of such (to me) inconsistent syntax? Is there a reason not to tag up a server? If so, what? If not, how to tag it as per best-practices?
答案1
得分: 0
为什么很难回答。
您可以通过继承的标签进行标记,https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/enable-tag-inheritance 或者通过基础设施即代码文件(bicep/arm)创建,这可以提供更一致的方式。
英文:
Why is hard to answer.
You can Tag via inherited tags, https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/enable-tag-inheritance or creation via Infrastructure as Code files (bicep/arm) which provide more consistency.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论