如何获取位置的显示名称:bicep/arm模板

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

bicep/arm template how to get display name of location

问题

在 Bicep 或 ARM 模板中,如何获取显示位置名称?
例如,我有输入位置名称 'westus',我想获取其显示名称,如 'West US',因为我需要将位置名称放在警报条件中,如下所示:

{
  field: 'properties.impactedServices[*].ImpactedRegions[*].RegionName',
  containsAny: [
    'west us'
  ]
}

顺便说一下,listLocations('/subscriptions/${subscriptionId}/providers/Microsoft.Web/locations/${toLower(location)}', '2016-06-01').displayName 似乎不起作用。

英文:

In bicep or arm template, how to get display location name?
Eg, I have input location name 'westus', I want to get its displayName like 'West US' since I have to put location name in an alert condition like:
{
field: 'properties.impactedServices[*].ImpactedRegions[*].RegionName'
containsAny: [
'west us'
]
}

By the way, ``listLocations('/subscriptions/${subscriptionId}/providers/Microsoft.Web/locations/${toLower(location)}', '2016-06-01').displayName
which seems not work.

答案1

得分: 0

我认为那是不可能的。即 此列表 不显示支持该功能,而 list* 操作实际上是 HTTP PUT 请求,而不是 HTTP GET

所以我预计您需要将这些数据添加到模板中。

英文:

I dont think thats possible. ie this list doesnt show that is supported. and list* operations are actually HTTP PUT requests, not HTTP GET.

So I'd expect you'd need to add that data to the template

huangapple
  • 本文由 发表于 2023年2月16日 18:10:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/75470703.html
匿名

发表评论

匿名网友

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

确定