Close

Parameterize logic apps

When trying to deploy a logic app via VSTS, I got an error stating: The workflow parameter ‘APIM_URL_Suffix’
is not found. I checked the LogicApp.parameters.json file and actually found the parameter in the parameter
file. So, how come it doesn’t work?

I found a very valuable post at: Kloud.com.au

From this link I learned there is a difference between ARM template parameters and logic app parameters. The parameters stored in LogicApp.parameters.json are ARM template parameters. To use those you need to work use the following syntax: [parameters(‘myparameter’)]. So, you need to use square brackets.

If you try to use ARM template parameters as a part of a workflow definition language statement, you have
to use the ARM template concat function. For example:
“template”: “[concat(‘/’, uriComponent(uriComponent(parameters(‘APIM_URL_Suffix’))), ‘/’, uriComponent
(uriComponent(parameters(‘MessageConnector’))), ‘/api/message/GetClienteleSyncDateTime’)]”

As we can see, the existing Workflow Definition Language function of encodeURIComponent() has been replaced with template function uriComponent().

Although ARM template parameters from the parameters.json file are used, you still have to add the parameters to the parameter section in the json file. Double-click the json file to get to the parameters section (don’t open with the Logic App Designer).

Leave a Reply

Your email address will not be published. Required fields are marked *