How to escape single quote in ARM template

前端 未结 4 1109
天涯浪人
天涯浪人 2020-12-16 10:58

Given the following resource in an AzureRM template, how would one encode the single quote in the commandToExecute part?



        
4条回答
  •  抹茶落季
    2020-12-16 11:20

    You escape Azure ARM functions in the same way as with VB strings: you simply double the single quote characters.

    [concat('This is a ''quoted'' word.')]
    

    outputs

    This is a 'quoted' word.
    

    Double quotes still needs to be escaped from JSON.

     [concat('''single'' and \"double\" quotes.')]
    

    outputs

    'single' and "double" quotes.
    

提交回复
热议问题