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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic Apps Standard VS Code inline JavaScript 'No connection could be made because the target machine actively refused it' #1017

Closed
Jeroen-VdB opened this issue Mar 20, 2024 · 4 comments
Labels

Comments

@Jeroen-VdB
Copy link

Jeroen-VdB commented Mar 20, 2024

Describe the Bug

Is there any news about a fix/or am I doing something wrong for running inline JavaScript actions locally in VS Code on Windows without needing to spin up the JS Analysis manually?

As of 2024 I'm still struggling with running workflows that have inline JavaScript actions in VS Code locally.
I've followed #659 and was able to run the workflows after manually spinning up the JS Analysis index.js script.
If I don't do this, I get the following log statement:

Workflow 'stateful_with_js' validation and creation failed. Error: 'One or more errors occurred. 
('No connection could be made because the target machine actively refused it. (localhost:61740)'. 
Status code: 'InternalServerError'.)

And the workflow is not added, resulting in a 404 when I try to call the trigger or go to the overview page.

The reason why I still have an issue, is because I'm trying to use https://github.com/michaelstephensonuk/IntegrationPlaybook-LogicApp-Standard-Testing, based on example https://github.com/michaelstephensonuk/IntegrationPlaybook-LogicApp-Standard-Testing-Example/blob/main/logicapp.testing.unittests/ReadMe.md, both locally in VS Code as well as in an Azure DeveOps pipeline. But the workaround from the discussion does not work here.

OS
Windows 11

Azure Logic Apps (Standard) VS Code Extension
v2.125.2

Azure Functions Core Tools
Core Tools Version: 4.0.5571 Commit hash: N/A +9a5b604f0b846df7de3eb37b423a9eba8baa1152 (64-bit)
Function Runtime Version: 4.30.0.22097

Microsoft.Azure.Functions.ExtensionBundle.Workflows
1.58.21

node --version: v20.11.1
Different from ...\.azurelogicapps\dependencies\NodeJs> .\node.exe --version: v18.17.1

Plan Type

Local

Steps to Reproduce the Bug or Issue

  1. Create workflow
  2. Add a Http trigger and a JavaScriptCode action
  3. Run Logic App using Attach to .NET Functions launch config
  4. Try to trigger the Logic App, resulting in a 404

Workflow JSON

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Response": {
                "type": "Response",
                "kind": "Http",
                "inputs": {
                    "statusCode": 200,
                    "body": "@outputs('Execute_JavaScript_Code')"
                },
                "runAfter": {
                    "Execute_JavaScript_Code": [
                        "SUCCEEDED"
                    ]
                }
            },
            "Execute_JavaScript_Code": {
                "type": "JavaScriptCode",
                "inputs": {
                    "code": "return \"test\";"
                },
                "runAfter": {}
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "Request": {
                "type": "Request",
                "kind": "Http"
            }
        }
    },
    "kind": "Stateful"
}

local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "WORKFLOWS_SUBSCRIPTION_ID": "",
    "LogicAppsNodePort": "60123"
  }
}

host.json

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle.Workflows",
    "version": "[1.*, 2.0.0)"
  },
  "extensions": {
    "workflow": {
      "Settings": {
        "Runtime.ApplicationInsightTelemetryVersion": "v2"
      }
    }
  },
  "logging": {
    "logLevel": {
      "default": "Information",
      "Workflow.Operations.Actions": "Information",
      "Workflow.Operations.Runs": "Information",
      "Workflow.Operations.Triggers": "Information",
      "Workflow.Operations.Batch": "Information"
    }
  }
}

Screenshots or Videos

No response

Additional context

No response

AB#27249342

Copy link

github-actions bot commented May 4, 2024

This issue is stale because it has been open for 45 days with no activity.

@github-actions github-actions bot added the stale label May 4, 2024
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@TimoKarhu
Copy link

+1 I have the same issue

@TimoKarhu
Copy link

To add to this topic, after enabling above workaround and making workflow run, I noticed that whatever changes I do to workflow.json will not be deployed to locally running vscode environment.

I got changes to be run only by

  • removing the workaround
  • make changes to workflow.json
  • stopping and starting local runtime (shift F5 + ctrl F5)
  • enabling the workaround
  • stopping and starting local runtime (shift F5 + ctrl F5)
    = now I could run the changes I wanted locally.

No idea why it behaves like this but perhaps inline JS and Logic App Standard on vscode quite isn't an option to develop these?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants