简体   繁体   English

持久功能无法启动

[英]durable function unable to start

I'm having trouble to get started with azure durable functions in c#. 我在使用C#中的Azure持久功能时遇到了麻烦。 Took this as sample and tried to start it in visual studio 2017 from https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-sequence 将此作为示例并尝试从https://docs.microsoft.com/zh-cn/azure/azure-functions/durable-functions-sequence在Visual Studio 2017中启动

using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;

namespace VSSample
{
    public static class HelloSequence
    {
        [FunctionName("E1_HelloSequence")]
        public static async Task<List<string>> Run(
            [OrchestrationTrigger] DurableOrchestrationContext context)
        {
            var outputs = new List<string>();

            outputs.Add(await context.CallActivityAsync<string>("E1_SayHello", "Tokyo"));
            outputs.Add(await context.CallActivityAsync<string>("E1_SayHello", "Seattle"));
            outputs.Add(await context.CallActivityAsync<string>("E1_SayHello", "London"));

            // returns ["Hello Tokyo!", "Hello Seattle!", "Hello London!"]
            return outputs;
        }

        [FunctionName("E1_SayHello")]
        public static string SayHello([ActivityTrigger] string name)
        {
            return $"Hello {name}!";
        }
    }
 }

But I'll get this error: "The listener for function 'E1_SayHello' was unable to start. Microsoft.WindowsAzure.Storage: Unable to connect to the remote server. System: Unable to connect to the remote server. System: No connection could be made because the target machine actively refused it 127.0.0.1:10000." 但是我会收到此错误:“函数'E1_SayHello'的侦听器无法启动。Microsoft.WindowsAzure.Storage:无法连接到远程服务器。系统:无法连接到远程服务器。系统:无法连接因为目标计算机主动拒绝了127.0.0.1:10000。

local.settings.json: local.settings.json:

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "AzureWebJobsDashboard": "UseDevelopmentStorage=true"
  }
}

Do i need something else to be done or should this work out of the box? 我是否需要做其他事情还是应该立即使用? What I need to have in port 10000? 我需要在端口10000中拥有什么?

My spidey senses are tingling here 我的蜘蛛般的感觉在这里刺痛

Did you read 你读过了吗

Function chaining in Durable Functions - Hello sequence sample 持久函数中的函数链接-Hello序列示例

Prerequisites 先决条件

Follow the instructions in Install Durable Functions to set up the sample. 请遵循“ 安装耐用功能”中的说明来设置示例。

Install the Durable Functions extension and samples (Azure Functions) 安装耐用功能扩展和示例(Azure功能)

Prerequisites 先决条件

  • Install the latest version of Visual Studio (version 15.3 or greater). 安装最新版本的Visual Studio(版本15.3或更高版本)。 Include the Azure development workload in your setup options. 在安装选项中包括Azure开发工作负载。 Start with sample functions 从示例功能开始
  • Download the Sample App .zip file for Visual Studio. 下载适用于Visual Studio的示例应用程序.zip文件。 You don't need to add the NuGet reference because the sample project already has it. 您不需要添加NuGet引用,因为示例项目已经有了它。
  • Install and run Azure Storage Emulator version 5.2 or later. 安装并运行Azure Storage Emulator 5.2或更高版本。 Alternatively, you can update the local.appsettings.json file with real Azure Storage connection strings . 或者,您可以使用实际的Azure存储连接字符串更新local.appsettings.json文件
  • Open the project in Visual Studio 2017. For instructions on how to run the sample, start with Function chaining - Hello sequence sample. 在Visual Studio 2017中打开项目。有关如何运行示例的说明,请从函数链接-Hello序列示例开始。 The sample can be run locally or published to Azure . 该示例可以在本地运行或发布到Azure

The error is most likely trying to connect to the emulator and is not installed or set up. 该错误最有可能试图连接到仿真器,并且未安装或设置。

So did you follow these steps? 那你遵循这些步骤了吗?

Use the Azure storage emulator for development and testing 使用Azure存储模拟器进行开发和测试

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

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