Azure / LogicAppsUX

https://learn.microsoft.com/azure/logic-apps
MIT License
71 stars 72 forks source link

Run History in VS Code execution does not register #3705

Closed brad302 closed 7 months ago

brad302 commented 7 months ago

Describe the Bug with repro steps

Put simply, once I kick off my LA workspace project, I fire off an execution of the boilerplate flow (as per these instructions ... https://learn.microsoft.com/en-us/azure/logic-apps/create-run-custom-code-functions) and the run history never registers.

I know the flow runs because debug points are hit and an external execution using Postman returns a result.

I've had a read, searched and ultimately found nothing that may help correct this.

What type of Logic App Is this happening in?

Standard (VSCode)

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#",
    "actions": {
      "Call_a_local_function_in_this_logic_app": {
        "type": "InvokeFunction",
        "inputs": {
          "functionName": "TestFunction",
          "parameters": {
            "zipCode": 85396,
            "temperatureScale": "Celsius"
          }
        },
        "runAfter": {}
      },
      "Response": {
        "type": "Response",
        "kind": "http",
        "inputs": {
          "statusCode": 200,
          "body": "@body('Call_a_local_function_in_this_logic_app')"
        },
        "runAfter": {
          "Call_a_local_function_in_this_logic_app": [
            "Succeeded"
          ]
        }
      }
    },
    "triggers": {
      "When_a_HTTP_request_is_received": {
        "type": "Request",
        "kind": "Http",
        "inputs": {}
      }
    },
    "contentVersion": "1.0.0.0",
    "outputs": {}
  },
  "kind": "Stateless"
}

Screenshots or Videos

You can see below, there are two executions and yet no run history.

image

Browser

Chrome

Additional context

No response

AB#25862292

hartra344 commented 7 months ago

@ccastrotrejo can you take a look?

ccastrotrejo commented 7 months ago

Hi @brad302. Thank you so much for raising this issue. I looked at the workflow structure that you shared with us and it seems that the kind of workflow is stateless. For stateless workflows no run history is saved. I suggest you to change the kind to Stateful . You can learn more about the differences in here

Another option is to enable momentary the run history for Stateless workflows. You can find the documentation on how to do that here

Please give it a try and let me know if this doesn't work

brad302 commented 7 months ago

Ahhhh, thanks @ccastrotrejo, I didn't even notice that section of the documentation. Will check it out.

brad302 commented 7 months ago

@ccastrotrejo interestingly enough, that actually didn't do the trick. I honestly thought it would but I still get no history when debugging in VS Code. Any other thoughts?

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsSecretStorageType": "Files",
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "ProjectDirectoryPath": "c:\\Repos\\LogicApps Standard\\LogicAppsWorkspace\\Workspace\\LogicApp",
    "Workflows.StatelessWorkflow.OperationOptions": "WithStatelessRunHistory"
  }
}

(To be clear, my workflow is called StatelessWorkflow)

Good news is, stateful behaves exactly as you've described.

ccastrotrejo commented 7 months ago

Hi @brad302, I looked again at the documentation, and it only says that the user should update the local.settings.json inside the workflow-designtime folder, however the update needs to be done also in the root local.settings.json. I did the change in both files and I was able to get the run history for stateless workflows. You can see the change by the overview page as the state type now says (debug mode). Could you please give it a try? Thanks!

Screenshot 2023-11-17 at 8 19 44 AM
brad302 commented 7 months ago

Will do, thanks for the update. Hopefully the documentation is also updated based on our conversation.

brad302 commented 7 months ago

@ccastrotrejo thanks for that, I've confirmed that it now works.

ccastrotrejo commented 7 months ago

@brad302 Sure thing, I am glad it worked!