Search code examples
azureazure-functionsazure-functions-core-tools

Not able to create Azure Logic App workflow using Visual Studio Code


Trying to follow this tutorial.

When I right click the workflow.json and select Open in Designer, I finally get the following message.

[2021-11-11T16:25:32.880Z] A host error has occurred during startup operation 'ae98f37d-d7d4-4131-920d-a725de7dc6cb'.
[2021-11-11T16:25:32.880Z] Microsoft.Extensions.DependencyInjection: Cannot access a disposed object.
[2021-11-11T16:25:32.880Z] Object name: 'IServiceProvider'.
9:56:42 pm: Running command: "func host start --port 8000"...

Azure Functions Core Tools
Core Tools Version:       4.0.3971 Commit hash: d0775d487c93ebd49e9c1166d5c3c01f3c76eaaf  (64-bit)
Function Runtime Version: 4.0.1.16815

[2021-11-11T16:26:43.913Z] ExtensionStartupType EventHubsWebJobsStartup from assembly 'Microsoft.Azure.WebJobs.EventHubs, Version=4.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not meet the required minimum version of 4.2.0.0. Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.EventHubs to 4.2.0 or later.
[2021-11-11T16:26:43.917Z] A host error has occurred during startup operation 'c15e2264-73c8-4f04-b0fd-7498d70f31c9'.
[2021-11-11T16:26:43.917Z] Microsoft.Azure.WebJobs.Script: One or more loaded extensions do not meet the minimum requirements. For more information see https://aka.ms/func-min-extension-versions.
[2021-11-11T16:26:43.917Z] ExtensionStartupType EventHubsWebJobsStartup from assembly 'Microsoft.Azure.WebJobs.EventHubs, Version=4.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not meet the required minimum version of 4.2.0.0. Update your NuGet package reference for Microsoft.Azure.WebJobs.Extensions.EventHubs to 4.2.0 or later.
[2021-11-11T16:26:43.917Z] .
Value cannot be null. (Parameter 'provider')
[2021-11-11T16:26:43.945Z] A host error has occurred during startup operation '13d7a2b9-4b0a-494f-a11a-0d4862a718b1'.
[2021-11-11T16:26:43.945Z] Microsoft.Extensions.DependencyInjection: Cannot access a disposed object.
[2021-11-11T16:26:43.945Z] Object name: 'IServiceProvider'.

I even updated the csproj file with the command

dotnet add package Microsoft.Azure.WebJobs.Extensions.EventHubs --version 4.3.0

But the problem persisted.

Azure Logic App with Visual Studio Code

Also as you can see, the designer tries to fetch something, and it says it Failed to fetch

And finally as you can see in the bottom right of the image, I get this message

Workflow validation failed: request to http://localhost:8000/runtime/webhooks/workflow/api/management/workflows/Stateful1/validate?api-version=2019-10-01-edge-preview failed, reason: connect ECONNREFUSED 127.0.0.1:8000. The source indicated is Azure Logic Apps (Standard) (Extension)

Any ideas?

I found one more YouTube tutorial but I am not able to get that working on my machine.

Raised issue here as well on github.


Solution

  • i had the same issue. In my case the solution was to go under Control Panel and uninstall Azure Function Core Tool (4.x) (if available). Afterwards open your Powershell and run following command:

    npm install -g azure-functions-core-tools@3 --unsafe-perm false