繁体   English   中英

无法使用 Visual Studio Code 调试 Azure 逻辑应用工作流

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

我正在关注教程。

我现在可以在 Visual Studio Code 中创建工作流,并且可以在设计器中看到它。

Visual Studio Code 中的请求响应逻辑应用

但除此之外,单击概览后,我无法看到此处提到的 url。

Visual Studio Code 上下文菜单中 Azure Logic App Workflow.json 文件的概述

我收到这条消息

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.'

Visual Studio Code 中的 Azure 逻辑应用 Workflow.json 文件概述

我错过了什么?

我确保 Azurite正在运行。

蓝晶石正在运行

Ngrok也被配置了。

Ngrok 已配置

而我的 local.settings.json 文件如下所示。

{
  "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"
  }
}

不仅如此,当我按 F5 时,我收到以下错误,我不清楚它在说什么。

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'.

无法在 Visual Studio Code 中调试 Azure 逻辑应用

也在github Azure-Functions上提出。

更新

Global.json 和 dotnet 列表 sdks

乌馆 2

我现在明白了

在此处输入图像描述

感谢@VivekDev的更新,我终于找到了问题所在,经过了很长时间,终于可以在VS CODE 中调试逻辑应用了。 以下是我遵循的步骤:

  1. 创建逻辑应用在此处输入图像描述

2.根据我的sdk版本在我的根文件夹中添加了global.json文件

在此处输入图像描述

  1. 然后转换为基于 Nuget 的逻辑应用项目,如下所示。

在此处输入图像描述

  1. 这是 localsettings.json 文件示例代码,您可以根据您的凭据尝试使用以下代码。

     "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/"

    在此处输入图像描述

  1. 安装ngrok并使用我的身份验证令牌授权,然后通过运行 cmd ngrok http 7071连接到port 7071 7071。

在此处输入图像描述

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逻辑应用程序在此处成功运行的代码是以下屏幕截图以供参考。

在此处输入图像描述

在此处输入图像描述

最后这是我成功运行的逻辑应用程序:创建的工作流: 在此处输入图像描述

成功运行工作流

在此处输入图像描述

参考:- 微软文档

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM