LogicAppsUX icon indicating copy to clipboard operation
LogicAppsUX copied to clipboard

Logic App Consumption - New Designer Error with Response Action

Open mikeholdorf opened this issue 1 year ago • 3 comments

Describe the Bug with repro steps

Select the Logic App Workflow and Select Designer

The Response Actions all show errors: Unable to initialize operation details for operation - Unsupported operation kind undefined for response type

Change to the old designer and everything shows fine

The Logic Apps are running fine, but we are deploying new versions and want to make sure we do not have any issues moving forward since these are in Production.

What type of Logic App Is this happening in?

Consumption (Portal)

Are you using new designer or old designer

New Designer

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

Workflow JSON

{
  "definition": {
    "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
    "contentVersion": "1.0.0.0",
    "triggers": {
      "manual": {
        "type": "Request",
        "description": "Request Sent by WebAPI to start the submission of an order",
        "kind": "Http",
        "inputs": {
          "schema": {
            "type": "object",
            "properties": {
              "OrderType": {
                "type": "string"
              },
              "OrderHeader": {
                "type": "object",
                "properties": {
                  "OrderNumber": {
                    "type": "string"
                  },
                  "CompanyNumber": {
                    "type": "string"
                  },
                  "CustomerNumber": {
                    "type": "string"
                  },
                  "WarehouseID": {
                    "type": "string"
                  },
                  "WillCall": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "BillingAddress": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "Name": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "Address1": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "Address2": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "City": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "State": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "Zip": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "Country": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "PhoneNumber": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ContactName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ContactEmail": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  },
                  "ShippingAddress": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "Name": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "Address1": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "Address2": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "City": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "State": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "Zip": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "Country": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "PhoneNumber": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ContactName": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "ContactEmail": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    }
                  },
                  "ShipToNumber": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "OrderDate": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "RequestedShipDate": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "Notes": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "PurchaseOrderNumber": {
                    "type": "string"
                  },
                  "OrderValueAmount": {
                    "type": "number"
                  },
                  "TotalDiscountAmount": {
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                }
              },
              "OrderDetails": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "LineNumber": {
                      "type": "number"
                    },
                    "WarehouseID": {
                      "type": "string"
                    },
                    "ItemType": {
                      "type": "string"
                    },
                    "ItemNumber": {
                      "type": "string"
                    },
                    "ItemDescription1": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "ItemDescription2": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "OrderQuantity": {
                      "type": "number"
                    },
                    "OrderUnitOfMeasure": {
                      "type": "string"
                    },
                    "DiscountPercentage": {
                      "type": "number"
                    },
                    "SellPrice": {
                      "type": "number"
                    },
                    "TotalLineAmount": {
                      "type": "number"
                    },
                    "PriceOverride": {
                      "type": "string"
                    },
                    "PromotionCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "PromotionVendorCode": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "PromotionDescription": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "PercentageOffItem": {
                      "type": [
                        "decimal",
                        "null"
                      ]
                    },
                    "LineItemDiscountAmount": {
                      "type": [
                        "decimal",
                        "null"
                      ]
                    },
                    "PricingTier": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "VendorDiscountPortion": {
                      "type": [
                        "decimal",
                        "null"
                      ]
                    },
                    "VendorPortionApplied": {
                      "type": [
                        "decimal",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "actions": {
      "ValidateOrderFunction": {
        "type": "Function",
        "description": "Function to validate data",
        "inputs": {
          "body": "@triggerBody()",
          "headers": {
            "Content-Type": "application/json",
            "ERP": "@{body('GetERPForValidation')?['ERP']}"
          },
          "function": {
            "id": "/subscriptions/b8a3bced-53f6-4b03-b82a-b9c4db38f7e9/resourceGroups/asc-dev-cus-ecomm-rg/providers/Microsoft.Web/sites/asc-dev-cus-ecomm-orders-b2b-fa/functions/ValidateOrderFunction"
          },
          "retryPolicy": {
            "type": "fixed",
            "count": 1,
            "interval": "PT5S"
          }
        },
        "runAfter": {
          "GetERPForValidation": [
            "Succeeded"
          ]
        },
        "operationOptions": "DisableAsyncPattern"
      },
      "Response-InvalidOrder": {
        "runAfter": {
          "ValidateOrderFunction": [
            "Failed",
            "TimedOut"
          ]
        },
        "trackedProperties": {
          "Msg:Error": "@take(string(action()?['inputs']?['body']), 15000)"
        },
        "type": "Response",
        "inputs": {
          "statusCode": "@outputs('ValidateOrderFunction')['statusCode']",
          "headers": {
            "Content-Type": "application/json"
          },
          "body": "@body('ValidateOrderFunction')"
        }
      },
      "SendOrderToTopic": {
        "type": "ApiConnection",
        "inputs": {
          "host": {
            "connection": {
              "name": "@parameters('$connections')['servicebus_1']['connectionId']"
            }
          },
          "method": "post",
          "body": {
            "CorrelationId": "@{workflow().run.name}",
            "ContentData": "@{base64(body('ValidateOrderFunction'))}",
            "ContentType": "application/json",
            "Properties": {
              "OrderType": "@triggerBody()?['OrderType']",
              "ERP": "@{body('AscB2BErpRouter')?['Erp']}"
            }
          },
          "path": "/@{encodeURIComponent(encodeURIComponent('asc-ecommerce-orders'))}/messages",
          "queries": {
            "systemProperties": "None"
          },
          "retryPolicy": {
            "type": "fixed",
            "count": 1,
            "interval": "PT5S"
          }
        },
        "runAfter": {
          "AscB2BErpRouter": [
            "Succeeded"
          ]
        },
        "operationOptions": "DisableAsyncPattern",
        "trackedProperties": {
          "ERP": "@action()?['inputs']?['body']?['Properties']?['ERP']"
        }
      },
      "Response-ErpRouterError": {
        "runAfter": {
          "AscB2BErpRouter": [
            "Failed",
            "TimedOut"
          ]
        },
        "trackedProperties": {
          "Msg:Error": "@take(string(action()?['inputs']?['body']), 15000)"
        },
        "type": "Response",
        "inputs": {
          "statusCode": "@outputs('AscB2BErpRouter')['statusCode']",
          "headers": {
            "Content-Type": "application/json"
          },
          "body": "@body('AscB2BErpRouter')"
        }
      },
      "Response-OrderAccepted": {
        "runAfter": {
          "SendOrderToTopic": [
            "Succeeded"
          ]
        },
        "type": "Response",
        "inputs": {
          "statusCode": 200,
          "headers": {
            "Content-Type": "application/json"
          }
        }
      },
      "Response-BusFailure": {
        "runAfter": {
          "SendOrderToTopic": [
            "Failed",
            "TimedOut"
          ]
        },
        "type": "Response",
        "inputs": {
          "statusCode": 500,
          "headers": {
            "Content-Type": "application/json"
          },
          "body": [
            {
              "Error": "Order could not be sent to the Orders topic."
            }
          ]
        }
      },
      "LogServiceBusError": {
        "type": "Compose",
        "inputs": {
          "statusCode": "@outputs('SendOrderToTopic')?['statusCode']",
          "message": "@outputs('SendOrderToTopic')?['body']?['message']"
        },
        "runAfter": {
          "Response-BusFailure": [
            "Succeeded"
          ]
        },
        "trackedProperties": {
          "Msg:Error": "@take(string(action()?['outputs']), 15000)"
        }
      },
      "AscB2BErpRouter": {
        "type": "Function",
        "inputs": {
          "body": {
            "GlobalWarehouseId": "@triggerBody()?['OrderHeader']?['WarehouseID']"
          },
          "method": "POST",
          "headers": {
            "Content-Type": "application/json"
          },
          "function": {
            "id": "/subscriptions/b8a3bced-53f6-4b03-b82a-b9c4db38f7e9/resourceGroups/asc-dev-cus-ecomm-rg/providers/Microsoft.Web/sites/asc-dev-cus-ecomm-erprouter-b2b-fa/functions/GetWhXrefByGlobalWhId"
          }
        },
        "runAfter": {
          "ValidateOrderFunction": [
            "Succeeded"
          ]
        }
      },
      "GetERPForValidation": {
        "type": "Function",
        "inputs": {
          "body": {
            "GlobalWarehouseId": "@triggerBody()?['OrderHeader']?['WarehouseID']"
          },
          "function": {
            "id": "/subscriptions/b8a3bced-53f6-4b03-b82a-b9c4db38f7e9/resourceGroups/asc-dev-cus-ecomm-rg/providers/Microsoft.Web/sites/asc-dev-cus-ecomm-erprouter-b2b-fa/functions/GetWhXrefByGlobalWhId"
          }
        },
        "runAfter": {}
      }
    },
    "outputs": {},
    "parameters": {
      "$connections": {
        "type": "Object",
        "defaultValue": {}
      }
    }
  },
  "parameters": {
    "$connections": {
      "value": {
        "servicebus_1": {
          "id": "/subscriptions/b8a3bced-53f6-4b03-b82a-b9c4db38f7e9/providers/Microsoft.Web/locations/centralus/managedApis/servicebus",
          "connectionId": "/subscriptions/b8a3bced-53f6-4b03-b82a-b9c4db38f7e9/resourceGroups/asc-dev-cus-ecomm-rg/providers/Microsoft.Web/connections/asc-dev-cus-ecomm-servicebus-ac",
          "connectionName": "asc-dev-cus-ecomm-servicebus-ac"
        }
      }
    }
  }
}

Screenshots or Videos

LA-NewDesigner

LA-OldDesigner

Browser

Edge and Safari

Additional context

We are currently updating our Logic App Consumptions workflows. We are using the V1 SQL Connector and need to upgrade all of them. We noticed this error when bringing up any Logic Apps that have a Response in them. We can change to the Legacy Designer, but we want to ensure that we do not hit any issues moving forward.

mikeholdorf avatar Mar 26 '24 15:03 mikeholdorf

So I'm not sure why it got saved this way but the reason for the problem is that the response actions are missing

"kind": "Http",

So a response action in code should look like:

{
    "Response-Test": {
        "inputs": {
            "body": "test",
            "headers": {
                "Content-Type": "application/json"
            },
            "statusCode": "200"
        },
        "runAfter": {
            "HTTP": [
                "Failed",
                "TimedOut"
            ]
        },
        "trackedProperties": {
            "Msg:Error": "test"
        },
        "type": "Response",
        "kind": "Http" // THis is the important part missing in your code
    }
}

@rllyy97 can we see if it's possible to safely fix the designer so it works without this kind or defaults to http in case there are others that are somehow in this situation?

hartra344 avatar Mar 26 '24 16:03 hartra344

Some of these Logic Apps where created about 7 years ago, so they are quite old, but they still work. In our Dev environment, I was able to change to the Legacy Designer, go to Code View and add: "kind": "Http" to all of the Response shapes that have errors. I saved, then changed to the New Designer and now everything looks good. So not sure if these are just so old that "kind" was not there at the time, but we can work around it for now.

mikeholdorf avatar Mar 26 '24 16:03 mikeholdorf

Sounds good, It could be that this was before there were different kinds. We'll see if we can add a default assumption here so the addition of kind isn't needed.

hartra344 avatar Mar 26 '24 18:03 hartra344