title: Deploy logic app using bicep - Convert JSON to valid Bicep
body: <p>I want to generate a bicepfor building a Logic App. The boilerplate for this would be</p>
  <pre><code>resource logicApp 'Microsoft.Logic/workflows@2019-05-01' = {
    name: 'lapp-${options.suffix}'
    location: options.location
    properties: {
      definition: {
        // here comes the definition
      }
    }
  }
  </code></pre>
  <p>My comment shows the point where the definition of the app itself would be placed. If I know take a JSON from an existing logic app (I spared some stuff for brevity):</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;definition&quot;: {
          &quot;$schema&quot;: &quot;https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#&quot;,
          &quot;actions&quot;: {},
          &quot;contentVersion&quot;: &quot;1.0.0.0&quot;,
          &quot;outputs&quot;: {},
          &quot;parameters&quot;: {},
          &quot;triggers&quot;: {
              &quot;manual&quot;: {
                  &quot;inputs&quot;: {
  
                  },
                  &quot;kind&quot;: &quot;Http&quot;,
                  &quot;type&quot;: &quot;Request&quot;
              }
          }
      },
      &quot;parameters&quot;: {}
  }
  </code></pre>
  <p>you would have to tranform this to something like this:</p>
  <pre><code>{
      definition: {
          '$schema': &quot;https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#&quot;
          actions: {}
          contentVersion: '1.0.0.0'
          outputs: {}
          parameters: {}
          triggers: {
              'manual': {
                  inputs: {
  
                  }
                  kind: 'Http'
                  type: 'Request'
              }
          }
      }
      parameters: {}
  }
  </code></pre>
  <p>That means for instance:</p>
  <ul>
  <li>remove trailing commas</li>
  <li>remove quotes on properties</li>
  <li>single quote some properties like the <code>schema</code> or custom action names</li>
  <li>escape single quotes when they appear in values which is common in Logic apps</li>
  </ul>
  <p>Is there any converter which can transform a JSON structure into a valid bicep? I do not mean <code>bicep decompile</code> because this assumes that you've got an already valid ARM template.</p>