0

I am migrating Azure Logic Apps in Consumption model to Standard model. The present logic app json file defines variables, some examples are given below:

"variables": {  
  "give_dev_when_test": "[if(equals(parameters('environment'), 't'), 'd', parameters('environment'))]", 
  "resource_name_prefix": "[concat('abc-', parameters('environment'), '-common')]", 
  "key_vault_name": "[concat('abc-', variables('give_dev_when_test'), '-common-kv')]"
}

I see in Standard Logic Apps we can define connections in connections.json which can reference  parameters from parameters.json such as @parameters('P1'). Parameters in turn can refer app settings such as @appsetting('S1')

Where should I move the variables defined in the existing Logic App to the Logic App Standard? I was thinking of moving them to either parameters or app settings. But in my preliminary experiments I see that parameters cannot refer other parameters within parameters.json and the same is true for app settings. Also both do not support expressions such as @concat(parameters('P1'), parameters('P2')). In this scenario what will be the recommended destination for all the variables (there are a lot of them) when migrating to Standard Logic Apps.

I do not want to move all the variables into the workflow itself and build their values there as it would make their code more complex.

arung
  • 111
  • 1
  • 1
  • 7

1 Answers1

1

AFAIK, this is not possible. Consider if your variable is dynamic and changes for every run, then you must include those variables in your workflow since the scope of the variable is confined to that particular run only. Else, If the variables you are trying to define are static and doesn't change throughout the run, then you can make use of parameters. However, you can only use those values and not update it.

However, if you are trying to migrate logic app from consumption plan to standard plan, then you can directly copy code view of consumption plan to standard plan logic app by adding "kind": "Stateful" or "kind": "Stateless" to your standard logic app.

enter image description here

Results:

enter image description here

SwethaKandikonda
  • 7,513
  • 2
  • 4
  • 18
  • I believe what I am looking at is NOT the code of Logic App Consumption but the corresponding ARM template (with variables, parameters and resources). Starting with these can I craft ARM templates to create Logic App Standard workflows? – arung May 15 '23 at 10:18
  • @arung, I understand that you are seeing the arm template. Here I provided an alternative to migrate it faster rather than editing the whole arm template and creating the logic app. Mind that code view is different from arm template. – SwethaKandikonda May 15 '23 at 11:19
  • If I just migrate the code from Consumption to Standard, what happens to the variables? Shouldn't I instead try to migrate the entire ARM template from Consumption to Standard to cover everything? – arung May 15 '23 at 12:09
  • @arung if you are talking about the variables inside the workflow, then yes they will migrate. If there are any Authorized connectors, you just need to login to them. – SwethaKandikonda May 15 '23 at 12:16
  • As I said I really have an ARM template of Logic App (Consumption) having variables (please see a snippet in my original question above), those variables are substituted by their runtime value (I do not see the variables in the code view of Logic App). So to preserve this behaviour I was thinking of crafting the ARM template for Logic App Standard workflow. Do you think this will work? – arung May 15 '23 at 12:22