title: How to escape single quote in ARM template
body: <p>Given the following resource in an AzureRM template, how would one encode the single quote in the <code>commandToExecute</code> part?</p>
  
  <pre class="lang-json prettyprint-override"><code>{
    "type": "Microsoft.Compute/virtualMachines/extensions",
    "name": "[concat(variables('vmNameMaster'), copyIndex(), '/sethost')]",
    "apiVersion": "2015-06-15",
    "location": "[resourceGroup().location]",
    "copy": {
        "name": "extensionLoopNode",
        "count": "[variables('masterCount')]"
    },
    "dependsOn": [
        "[concat('Microsoft.Compute/virtualMachines/', variables('vmNameMaster'), copyIndex(),'/extensions/DockerExtension')]"
    ],
    "properties": {
      "publisher": "Microsoft.OSTCExtensions",
      "type": "CustomScriptForLinux",
      "typeHandlerVersion": "1.4",
      "settings": {
        "fileUris": [ ],
        "commandToExecute": "[concat('/bin/bash -c \'echo \"export DOCKER_HOST=:2375\" &gt;&gt; /home/', parameters('adminUsername') ,'/.profile\'')]",
        "timestamp": 123456789
      }
    }
  },
  </code></pre>