Reputation: 5500
I am planning to provision the logic app using terraform script. But the workflow of logic app, I am deploying through the arm templates.
Is this recommended approach?
Can anyone suggest me how to deploy the logic app with business flow?
Upvotes: 1
Views: 2224
Reputation: 14669
Logic apps are kind of counter-intuitive when it comes to Terraform. It is an Azure service that is designed to abstract away custom coding with an easy-to-use user interface. Designing something in a user interface often does not work well when using multiple environments (e.g. test, staging, production). This conflicts heavily with one of the main purposes of Terraform: matching infrastructure across multiple environments.
Of course, you can turn to the magic of ARM templates, but mankind did not invent JSON to be readable. And Azure never had a plan to support YAML for ARM templates. So how to proceed from here? I set out our requirements, solution and a terraform example below.
Requirements
Solution
azurerm_logic_app_workflow
. This resource will be deployed across all environments. It is empty, so you will find the Logic App in the Azure Portal without any content. This means that in your dev environment, you can use the GUI to design the Logic App.azurerm_resource_group_template_deployment
which will only be deployed based on a condition. This condition is true when you supply an arm template path, which will not be the case in the dev environment.azurerm_resource_group_template_deployment
depends on azurerm_logic_app_workflow
and set deployment_mode = "Incremental"
. Furthermore you can supply parameters to the logic app by setting parameters_content = jsonencode(var.parameters_map)
.Example
A working terraform example can be found on Github.
Note: another high-level Azure service is Data Factory, which faces the same problems when it comes to automatic deployments using Terraform.
Upvotes: 0