locked
Poor performance on initializing variables RRS feed

  • Question

  • I am attempting to initialize a variable to dynamic content (a JSON property from the HTTP request), this usually takes 0 seconds, but can take up to 38 seconds.  I was initially using an expression (converting string to int to store in an integer variable) but just initializing the passed in JSON property into a string variable without any expressions can still take 30+ seconds.

    Conditions like testing SQL Result Sets against empty sometimes take 10+ seconds as well.  I can understand making the SQL call, or checking Azure storage can take seconds, but just storing HTTP Request parameters and testing already returned SQL Result Sets should not be taking so long.

    Any ideas on how to improve general performance?


    • Edited by Tech048 Tuesday, May 26, 2020 11:40 PM grammar
    Tuesday, May 26, 2020 8:14 AM

All replies

  • Example code view:

    {
        "definition": {
            "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
            "actions": {
                "Initialize_FinancialYear": {
                    "inputs": {
                        "variables": [
                            {
                                "name": "Year",
                                "type": "string",
                                "value": "@triggerBody()['year']"
                            }
                        ]
                    },
                    "runAfter": {},
                    "type": "InitializeVariable"
                },
                "Response": {
                    "inputs": {
                        "body": "@variables('Year')",
                        "statusCode": 200
                    },
                    "kind": "Http",
                    "runAfter": {
                        "Initialize_FinancialYear": [
                            "Succeeded"
                        ]
                    },
                    "type": "Response"
                }
            },
            "contentVersion": "1.0.0.0",
            "outputs": {},
            "parameters": {},
            "triggers": {
                "manual": {
                    "inputs": {
                        "method": "POST",
                        "schema": {
                            "properties": {
                                "year": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "year"
                            ],
                            "type": "object"
                        }
                    },
                    "kind": "Http",
                    "operationOptions": "EnableSchemaValidation",
                    "type": "Request"
                }
            }
        },
        "parameters": {}
    }

    Tuesday, May 26, 2020 11:50 PM