Search code examples
azureazure-logic-appsazure-logic-app-standard

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


I am following this tutorial.

I am now able to create the workflow in Visual Studio Code, and also see that in the designer.

Request Response logic app in Visual Studio Code

But further to this, I am not able to see the url as mentioned here after clicking the overview.

Overview of Azure Logic App Workflow.json file in Visual Studio Code context menu

I get this message

Workflow run history could not be loaded. Error: 'Could not establish connection to the host. Run your function project to view the run history. Failed to fetch.'

Overview of Azure Logic App Workflow.json file in Visual Studio Code

What am I missing?

I ensured Azurite is running.

Azurite is running

NGrok is also configured.

NGrok is configured

And my local.settings.json file looks as follows.

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_V2_COMPATIBILITY_MODE": "true",
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "WORKFLOWS_TENANT_ID": "d5y4kk56-f47h-df6h-2g7k-sd4fk8f5j5zd",
    "WORKFLOWS_SUBSCRIPTION_ID": "876af6yz-6xxx-1234-2nh7-xxx234gygrkls",
    "WORKFLOWS_RESOURCE_GROUP_NAME": "vivek-logic-app-trial-rg",
    "WORKFLOWS_LOCATION_NAME": "centralindia",
    "WORKFLOWS_MANAGEMENT_BASE_URI": "https://management.azure.com/",
    "Workflows.WebhookRedirectHostUri": "http://e91c-115-96-216-18.ngrok.io"
  }
}

Not only that, when I press F5, I get the following error, not clear to me what it says.

Error message: correlationId='683df22d-5928-4149-97cc-2ee3116aa6d0', operationName='SubscriptionExtensions.ToCachedSubscription', message='Resource provider namespace is empty for subscription 'myedgeenvironment', properties '{"tenantId":"myedgeenvironment-tenantId","registeredFeatures":[]}'.', exception='<null>', organizationId='', activityVector='IN.02', additionalProperties='', extensionVersion='1.0.0.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='683df22d-5928-4149-97cc-2ee3116aa6d0'.

Not able to debug Azure Logic Apps in Visual Studio Code

Raised on github Azure-Functions as well.

Update

Global.json and dotnet list sdks

Udate 2

I now get this

enter image description here


Solution

  • Thank you for the update @VivekDev , I Finally figured out the problem and was able to debug the logic app in VS CODE after a long time. Here are the steps that i followed:

    1. Created logic app enter image description here

    2.Added global.json file according to my sdk version in my root folder

    enter image description here

    1. Then Convert to Nuget-based Logic App project as followed .

    enter image description here

    1. Here is localsettings.json file sample code you can try with the following code according to your credential.

      "IsEncrypted": false,
         "Values": {
           "AzureWebJobsStorage": "UseDevelopmentStorage=true",
           "FUNCTIONS_WORKER_RUNTIME": "node",
           "WORKFLOWS_TENANT_ID": "",
           "WORKFLOWS_SUBSCRIPTION_ID": "",
           "WORKFLOWS_RESOURCE_GROUP_NAME": "xxxxxx",
           "WORKFLOWS_LOCATION_NAME": "westus2",
           "WORKFLOWS_MANAGEMENT_BASE_URI": "https://management.azure.com/"
      

      enter image description here

    1. installed ngrok and authorized using my authentication token and then Connect to the port 7071 by running cmd ngrok http 7071 .

    enter image description here

    Then run the logic app and meanwhile go to workflow.json overview tab and then you will get url ,(may be you will get the same error at that time in your terminal) Copy and browse that same url in your browser then check in vs code that logic app run successfully here are the below screenshots for reference .

    enter image description here

    enter image description here

    Finally here is my successfully running logic app : Created workflow : enter image description here

    Successfully running workflow

    enter image description here

    REFERENCE:- MICROSOFT DOCUMENTATION