Search code examples
azureazure-logic-app-standard

how use Terrafrom to deploy azure logic app standard's workflows


I can deploy logic App standard using terraform however i am unable to deploy or import the workflows inside logic App standard .. any help would be greatly appreciated

Thanks


Solution

  • I can deploy logic App standard using terraform however i am unable to deploy or import the workflows inside logic App standard

    If you are facing issues while deploying your workflow, One of the workaround that you can try is to write an ARM template for the workflow and deploy ARM template to configure the workflow in the logic app.

    // Create an instance of logic app and configure the tags
    resource "azurerm_logic_app_workflow" "logicapp" {
      location            = "westeurope"
      resource_group_name = var.shared_env.rg.name
      tags                = var.shared_env.tags
    }
    
    // Deploy the ARM template to configure the workflow in the Logic App
    data "template_file" "workflow" {
      template = file(local.arm_file_path)
    }
    
    // Deploy the ARM template workflow
    resource "azurerm_template_deployment" "workflow" {
      depends_on = [azurerm_logic_app_workflow.logicapp]
    
      resource_group_name = var.shared_env.rg.name
      parameters = merge({
        "workflowName" = var.workflow_name,
        "location"     = "westeurope"
      }, var.parameters)
    
      template_body = data.template_file.workflow.template
    }
    

    If you are trying to deploy actions from terraform, Here is an example that you can refer to.

    REFERENCES:

    1. azurerm_logic_app_standard
    2. Deploying a LogicApp with Terraform