I want to generate a bicepfor building a Logic App. The boilerplate for this would be
resource logicApp 'Microsoft.Logic/workflows@2019-05-01' = {
name: 'lapp-${options.suffix}'
location: options.location
properties: {
definition: {
// here comes the definition
}
}
}
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):
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {
"manual": {
"inputs": {
},
"kind": "Http",
"type": "Request"
}
}
},
"parameters": {}
}
you would have to tranform this to something like this:
{
definition: {
'$schema': "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#"
actions: {}
contentVersion: '1.0.0.0'
outputs: {}
parameters: {}
triggers: {
'manual': {
inputs: {
}
kind: 'Http'
type: 'Request'
}
}
}
parameters: {}
}
That means for instance:
- remove trailing commas
- remove quotes on properties
- single quote some properties like the
schemaor custom action names - escape single quotes when they appear in values which is common in Logic apps
Is there any converter which can transform a JSON structure into a valid bicep? I do not mean bicep decompile because this assumes that you've got an already valid ARM template.