title: ARM.Template from bash-script. Unterminated string. Expected delimiter:
body: <p>I am writing a bash-script for uploading certificate from a linux-server to azure keyvault using the "armclient"</p>
  
  <p>I follow this guide on how to use the armclient:
  <a href="https://blogs.msdn.microsoft.com/appserviceteam/2016/05/24/deploying-azure-web-app-certificate-through-key-vault/" rel="nofollow noreferrer">https://blogs.msdn.microsoft.com/appserviceteam/2016/05/24/deploying-azure-web-app-certificate-through-key-vault/</a></p>
  
  <p>The command i want to perform is this:</p>
  
  <pre><code>ARMClient.exe PUT /subscriptions/&lt;Subscription Id&gt;/resourceGroups/&lt;Server Farm Resource Group&gt;/providers/Microsoft.Web/certificates/&lt;User Friendly Resource Name&gt;?api-version=2016-03-01 "{'Location':'&lt;Web App Location&gt;','Properties':{'KeyVaultId':'&lt;Key Vault Resource Id&gt;', 'KeyVaultSecretName':'&lt;Secret Name&gt;', 'serverFarmId':'&lt;Server Farm (App Service Plan) resource Id&gt;'}}"
  </code></pre>
  
  <p>I have created a string that populates all the fields required:</p>
  
  <pre><code>putparm=$resolved_armapi" \"{'Location':'$resolved_locationid','Properties':{'KeyVaultId':'$resolved_keyvaultid','KeyVaultSecretName':'$certname','serverFarmId':'$resolved_farmid'}}"\"
  </code></pre>
  
  <p>When i echo the output of the variable putparm, the result looks as expected (X-ed out names/ids):</p>
  
  <pre><code>/subscriptions/f073334f-240f-4261-9db5-XXXXXXXXXXXXX/resourceGroups/XXXXXXXX/providers/Microsoft.Web/certificates/XXXX-XXXXX-XXXXX?api-version=2016-03-01 "{'Location':'Central US','Properties':{'KeyVaultId':'/subscriptions/f073334f-240f-4261-9db5-XXXXXXXXXXXXX/resourceGroups/XXXXXXXX/providers/Microsoft.KeyVault/vaults/XXXXXXXX','KeyVaultSecretName':'XXXX-XXXXX-XXXXX','serverFarmId':'/subscriptions/f073334f-240f-4261-9db5-XXXXXXXXXXXXX/resourceGroups/XXXXXXXX/providers/Microsoft.Web/serverfarms/ServicePlan59154b1c-XXXX'}}"
  </code></pre>
  
  <p>When i run <code>armclient put $putparm</code> in the script i get this error:</p>
  
  <blockquote>
    <p>"error": {
        "code": "InvalidRequestContent",
        "message": "The request content was invalid and could not be deserialized: 'Unterminated string. Expected delimiter: \". Path '',
    line 1, position 21.'."   }</p>
  </blockquote>
  
  <p>But when i take the output of the $putparm variable and run the command "manually" on the server, it works. </p>
  
  <p>I guess its something with the way linux store the variables and that the API is requesting JSON (or something..)</p>
  
  <p>Happy for any help.</p>