jeffhollan / LogicAppTemplateCreator

Script to convert Logic Apps into templates for deployment
MIT License
143 stars 74 forks source link

defaultValue - empty #129

Open nicwillemse opened 1 year ago

nicwillemse commented 1 year ago

I cannot find a way to extract a template without the defaultValue for connections, is there a way to do this?

rille111 commented 1 year ago

Just did this manually yesterday. Here´s a powershell snippet. It leaves [resourceGroup(..)] references alone.

$fileName = "path to the ARM template json file"
$regexPatternForRemoval = '"defaultValue": "(?![\[]).*"|"defaultValue": ([0-9]+)'
(Get-Content $fileName) -replace $regexPatternForRemoval, '"defaultValue": ""' | Set-Content $fileName