Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic_App_Standard resource creates without mandatory settings #18123

Open
1 task done
nichollsc81 opened this issue Aug 25, 2022 · 0 comments
Open
1 task done

Logic_App_Standard resource creates without mandatory settings #18123

nichollsc81 opened this issue Aug 25, 2022 · 0 comments

Comments

@nichollsc81
Copy link

nichollsc81 commented Aug 25, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.2.4

AzureRM Provider Version

3.17.0

Affected Resource(s)/Data Source(s)

azurerm_logic_app_standard

Terraform Configuration Files

resource "azurerm_logic_app_standard" "logic_app" {
    depends_on = [var.depends_list]
    for_each = var.logic-app-map

    name = "${var.az-resource-type}-${each.key}-${var.environment}-01"
    location = var.location
    resource_group_name = each.value.resource-group-name

    storage_account_name = each.value.storage-account-name
    storage_account_access_key = data.azurerm_storage_account.storage_accounts[each.key].primary_access_key

    app_service_plan_id = data.azurerm_service_plan.service_plan[each.key].id

    https_only = lookup(each.value,"https-only",null)

    version = lookup(each.value,"version",null)

    app_settings = {
        WEBSITE_DNS_SERVER = var.dns-servers[0]
        WEBSITE_DNS_ALT_SERVER = var.dns-servers[1]
    }

    site_config {
        always_on = true
    }

    identity {
        type = "SystemAssigned"
    }

    tags = var.tags
    lifecycle {
        ignore_changes = [
            tags["creation_timestamp"]
        ]
    }
}

Debug Output/Panic Output

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Expected Behaviour

LogicApp should be created with same default Configuration as if manually created via Portal.

Manually, the following default configs are set:

FUNCTIONS_WORKER_RUNTIME: node
WEBSITE_NODE_DEFAULT_VERSION: ~14

Actual Behaviour

Default config variables above are not set.

When a workflow is created inside the new logicapp, creating a Recurrence trigger results in a spurious, unrelated exception when triggered.

If you manually add the config variables above > save > restart logicapp, the trigger will now instantiate without issue.

Steps to Reproduce

  1. Create logic app using logic_app_standard resource
  2. Create workflow
  3. Add Recurrence trigger to workflow
  4. Trigger workflow

Important Factoids

No response

References

I believe defaults need to be set for this in ./internal/services/logic/logic_app_standard_resource.go:

// line: ~224
"node_version": {
	Type:     pluginsdk.TypeString,
	Optional: true,
	Default:  "~14",
},
...
// line: ~445
d.Set("node_version", appSettings["WEBSITE_NODE_DEFAULT_VERSION"])
...
//line: ~616
func getBasicLogicAppSettings(d *pluginsdk.ResourceData, endpointSuffix string) ([]web.NameValuePair, error) {
	storagePropName := "AzureWebJobsStorage"
	functionVersionPropName := "FUNCTIONS_EXTENSION_VERSION"
	contentSharePropName := "WEBSITE_CONTENTSHARE"
	contentFileConnStringPropName := "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING"
	appKindPropName := "APP_KIND"
	appKindPropValue := "workflowApp"
	workerRuntimeName := "FUNCTIONS_WORKER_RUNTIME"
	workerRuntimeValue := "node"
	nodeDefaultVersionName := "WEBSITE_NODE_DEFAULT_VERSION"
	nodeDefaultVersionValue := d.Get("node_version").(string)
...
	basicSettings := []web.NameValuePair{
		{Name: &storagePropName, Value: &storageConnection},
		{Name: &functionVersionPropName, Value: &functionVersion},
		{Name: &appKindPropName, Value: &appKindPropValue},
		{Name: &contentSharePropName, Value: &contentShare},
		{Name: &contentFileConnStringPropName, Value: &storageConnection},
		{Name: &workerRuntimeName, Value: &workerRuntimeValue},
		{Name: &nodeDefaultVersionName, Value: &nodeDefaultVersionValue},
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants