Skip to content

Switch support #448

@slavizh

Description

@slavizh

Is your feature request related to a problem? Please describe.
Provide option for Switch support. In cases where we have more then two choices we need switch support. I do not think Ternary operator can do that. In ARM templates you can solve that in some ways like having variable objects like

variables: { 
  "mySwitch": {
    "first": 1,
    "second": 2,
    "third": 3
   }
}

and of course when you need to use it you do something like:

 "someProperty": "[parameters('InputParameter')[string(variables('mySwitch'))]]"

You could basically have switch function and simplify that approach in Bicep. Downside is that I do not see a way of default value or more advanced ways of working like in PowerShell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions