5

I was wondering if it possible to reference concatenated variable name1 and name2 as part of build process? Suppose I'd like to create a resource group called winning-development. Where name1=winning-, and name2=development. enter image description here

enter image description here

WinBoss
  • 879
  • 1
  • 17
  • 40

1 Answers1

8

You don't need to do anything special to concatenate variables.

Let's say you had foo = 'hello' and bar = 'world'.

$(foo)$(bar) = 'helloworld'

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • Awesome! Thanks! Can I do something like [$(foo)$(bar)del1charactertotheright], so I can have helloworl without last character d? – WinBoss Dec 20 '17 at 10:20
  • No. There aren't string manipulation functions like you'd find in an ARM template. – Daniel Mann Dec 20 '17 at 12:29
  • 1
    Except that a literal and a variable adds a space rmdir foot$(toe) - where $toe) equals Big results in rmdir foot Big (note space) Not in rmdir footBig (no space) – David V. Corbin Feb 02 '21 at 16:47
  • @DavidV.Corbin That is not the case in my experience. – Daniel Mann Feb 02 '21 at 18:42
  • 1
    Daniel - goot to hear from you, it has been quite some time.... So, it looks like something on my end... will have to dig deeper. Just getting confirmation that it does not happen to everyone/all the time is quite valuable.... – David V. Corbin Feb 03 '21 at 14:22