jeffhollan / LogicAppTemplateCreator

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

Hardcoded values in actions not parameterized. #94

Closed freekwillem92 closed 3 years ago

freekwillem92 commented 3 years ago

When you are using connectors such a CRM(CDS) or ERP connectors in the action you still have hardcoded values to the environment name.

And I know this is can be a tricky one.

"Lists_items_present_in_table": { "runAfter": {}, "type": "ApiConnection", "inputs": { "host": { "connection": { "name": "@parameters('$connections')['dynamicsax']['connectionId']" } }, "method": "get", "path": "/datasets/@{encodeURIComponent(encodeURIComponent('xxxxx.cloudax.dynamics.com'))}/tables/@{encodeURIComponent(encodeURIComponent('CustomerGroups'))}/items" } I could see two resolutions to this, one is to resolve this "xxxxx.cloudax.dynamics.com" to an ARM template parameter. Or resolve this to a logic app parameter.

The upside of the ARM template parameter is that when you look at it in the designer experience everything works. If you change this to a logic app parameter it won't work at design time, but will work at runtime.

Logic App parameter "path": "/datasets/@{encodeURIComponent(encodeURIComponent(parameters('Organization')))}/tables/@{encodeURIComponent(encodeURIComponent('CustomerGroups'))}/items",

ARM parameter "path": "[concat('/datasets/@{encodeURIComponent(encodeURIComponent(''',parameters('Organization') ,'''))}/tables/@{encodeURIComponent(encodeURIComponent(''CustomerGroups''))}/items')]"

MLogdberg commented 3 years ago

Should be solve in PR #95 and on it's way to PowerShell Gallery

freekwillem92 commented 3 years ago

@MLogdberg That is great will test it. Thank you.

MLogdberg commented 3 years ago

Closing this since nothing is reported and it should be working