SQL Server在Azure CLI创建期间为什么无法添加标记?

huangapple go评论65阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年5月14日 21:15:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76247663.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定