2
votes

I'm having trouble to get started with azure durable functions in c#. 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

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

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?

1

1 Answers

2
votes

My spidey senses are tingling here

Did you read

Function chaining in Durable Functions - Hello sequence sample

Prerequisites

Follow the instructions in Install Durable Functions to set up the sample.

Install the Durable Functions extension and samples (Azure Functions)

Prerequisites

  • Install the latest version of Visual Studio (version 15.3 or greater). Include the Azure development workload in your setup options. Start with sample functions
  • Download the Sample App .zip file for Visual Studio. You don't need to add the NuGet reference because the sample project already has it.
  • Install and run Azure Storage Emulator version 5.2 or later. Alternatively, you can update the local.appsettings.json file with real Azure Storage connection strings.
  • Open the project in Visual Studio 2017. For instructions on how to run the sample, start with Function chaining - Hello sequence sample. The sample can be run locally or published to 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