azure - ARM 模板中有什么方法可以使用类似 Case 的语句吗?

标签 azure azure-resource-manager azure-rm-template

Azure 中是否有任何方法可以根据参数或变量的值使用类似于 CASE 的语句?

例如:

    if vmName = "DB" then adminloginName = "DBAdmin"
    if vmName = "RDP" then adminlogonNAme = "RDPAdmin"

最佳答案

,ARM 模板从今天起尚不支持类似于 Case 的语句。

但是,它们已经支持逻辑 if 函数。

Logical functions

Resource Manager provides the following functions for working with logical conditions:

  • and
  • bool
  • if
  • not
  • or

引用:Azure Resource Manager template functions - Logical Functions

关于azure - ARM 模板中有什么方法可以使用类似 Case 的语句吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48685408/

相关文章:

python - 使用 Python 的 Azure 函数 - Blob 触发器未触发

c# - Azure 资源组使用 SDK 设置标签?

azure - 为 azure linux 虚拟机设置防病毒的可能方法有哪些以及如何设置?

azure - Azure 中的事件日志警报

azure - Windows Azure 云应用程序 - 无法创建 SSL/TLS 安全通道

angular - 无法从 Azure 正确运行 Angular 4 应用程序

arrays - 使用 New-AzureRmResourceGroupDeployment 时无法在 powershell 中检索 ARM 输出数组

Azure:使用 ARM 模板部署日志警报失败

azure - 在嵌套 ARM 模板中使用 resourceId 函数时出错

azure - 如何使用 .Net SDK 更新在 Azure Key Vault 中创建的 secret 值