hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.53k stars 4.61k forks source link

Unable to see stack settings for logic app standard when deployed in workflow mode. #18017

Open shankaranand2013 opened 2 years ago

shankaranand2013 commented 2 years ago

Is there an existing issue for this?

Community Note

Terraform Version

1.2.4

AzureRM Provider Version

3.18.0

Affected Resource(s)/Data Source(s)

azurerm_logic_app_standard

Terraform Configuration Files

#App service plan
resource "azurerm_app_service_plan" "this" {
    name                         = "ASP_NAME"
    location                     = "Australia east"
    resource_group_name          = "RG_NAME"
    kind                         = "elastic"
    maximum_elastic_worker_count = 2
    reserved                     = false

    sku {
      tier     = "WorkflowStandard"
      size     = "WS1"
      capacity = 1
    }
  }

#Resource block 
resource "azurerm_logic_app_standard" "this" {
  name                       = "foo"
  location                   = "Australia east"
  resource_group_name        = "RG_NAME"
  app_service_plan_id        = "ASP_ID"
  storage_account_name       = "ST_NAME"
  storage_account_access_key = "ST.KEY"
  https_only                 = true
  version                    = "~1"
  identity {
    type = "SystemAssigned"
  }

  site_config {
    always_on                        = false
    dotnet_framework_version         = v4.0
    ftps_state                       = "FTPS only"
    health_check_path                = null
    http2_enabled                    = false
    min_tls_version                  = "1.2"
    pre_warmed_instance_count        = null
    runtime_scale_monitoring_enabled = false
    use_32_bit_worker_process        = true
    vnet_route_all_enabled           = false
    websockets_enabled               = false
    }
}

Debug Output/Panic Output

The terraform apply is successful but the "stack setting" under the general setting of the logic app is not present.

Expected Behaviour

The stack settings are created when we create them using the clickops, also they default to - node.js . But when we deploy using the terraform they appear to be missing.

Actual Behaviour

The terraform apply is successful but the "stack setting" under the general setting of the logic app is not present.

Steps to Reproduce

Run the tf files mentioned above.

Important Factoids

No response

References

No response

ziyeqf commented 2 years ago

Hi @shankaranand2013, thanks for opening the issue. Please try the following steps:

  1. adding the app_settings block with following values to azurerm_logic_app_standard block.

    app_settings = {
    "FUNCTIONS_WORKER_RUNTIME"     = "node"
    "WEBSITE_NODE_DEFAULT_VERSION" = "~14"
    }

    the azurerm_logic_app_standard resource should look like:

    resource "azurerm_logic_app_standard" "this" {
    name                       = "foo"
    location                   = "Australia east"
    resource_group_name        = "RG_NAME"
    app_service_plan_id        = "ASP_ID"
    storage_account_name       = "ST_NAME"
    storage_account_access_key = "ST.KEY"
    https_only                 = true
    version                    = "~1"
    identity {
    type = "SystemAssigned"
    }
    
    site_config {
    always_on                        = false
    dotnet_framework_version         = v4.0
    ftps_state                       = "FTPS only"
    health_check_path                = null
    http2_enabled                    = false
    min_tls_version                  = "1.2"
    pre_warmed_instance_count        = null
    runtime_scale_monitoring_enabled = false
    use_32_bit_worker_process        = true
    vnet_route_all_enabled           = false
    websockets_enabled               = false
    }
    
    app_settings {
    "FUNCTIONS_WORKER_RUNTIME"     = "node"
    "WEBSITE_NODE_DEFAULT_VERSION" = "~14"
    }
    }
  2. create logic apps.

The reason why to do so is that when creating Logic Apps via portal, portal added the default values to app settings. Please leave comments if it helps to your situation or there are any other questions.

shankaranand2013 commented 2 years ago

Hi @ziyeqf ,

Thank you for the settings. I updated them in the app settings block. Now the stack settings come up , but the node js version is not populated . The drop down menu is available for select but then only node.js version 6 is available. image

ziyeqf commented 2 years ago

Hi @shankaranand2013,

Thanks for your try. to resolve the Node.js version, please change the version of azurerm_logic_app_standard to ~3 as below.

resource "azurerm_logic_app_standard" "this" {
  name                       = "foo"
  location                   = "Australia east"
  resource_group_name        = "RG_NAME"
  app_service_plan_id        = "ASP_ID"
  storage_account_name       = "ST_NAME"
  storage_account_access_key = "ST.KEY"
  https_only                 = true
  version                    = "~3"
  identity {
    type = "SystemAssigned"
  }

  site_config {
    always_on                        = false
    dotnet_framework_version         = v4.0
    ftps_state                       = "FTPS only"
    health_check_path                = null
    http2_enabled                    = false
    min_tls_version                  = "1.2"
    pre_warmed_instance_count        = null
    runtime_scale_monitoring_enabled = false
    use_32_bit_worker_process        = true
    vnet_route_all_enabled           = false
    websockets_enabled               = false
  }

  app_settings {
    "FUNCTIONS_WORKER_RUNTIME"     = "node"
    "WEBSITE_NODE_DEFAULT_VERSION" = "~14"
  }
}

If it helps or any further questions, please leave comments.