title: Azure Durable Function AppSettings
body: <p>I'm trying to create an azure durable function but it's very difficult to find some normal guides on this subject. I've setup the DI and I try to read the settings of the function but it crashes</p>
  
  <p>I have setup an Azure Function project in VS 2019 and added a Durable Orchestrator Function Template. I removed all the "static" references from the class and all seem to work fine until I add the configurationbuilder in the startup file</p>
  
  <p>Can anyone explain to me how this should work or give some guidance, where to find some explanation of the configuration of a durable functions ? What should I have in the host.json , local.settings.json and how this changes be when I publish it on the portal ?</p>
  
  <p>My case is this. The startup file looks like this</p>
  
  <p>using Microsoft.Azure.Functions.Extensions.DependencyInjection;
  using Microsoft.Extensions.Configuration;</p>
  
  <pre><code>[assembly: FunctionsStartup(typeof(DurableFunctions.Startup))]
  namespace DurableFunctions
  {
      public class Startup : FunctionsStartup
      {
          public override void Configure(IFunctionsHostBuilder builder)
          {
              var settings = new ConfigurationBuilder()
                  .AddEnvironmentVariables()
                  .Build();
          }
      }
  }
  </code></pre>
  
  <p>The host.json is like this</p>
  
  <pre><code>{
    "version": "2.0"
  }
  </code></pre>
  
  <p>The local.settings.json</p>
  
  <pre><code>{
      "IsEncrypted": false,
      "Values": {
          "AzureWebJobsStorage": "UseDevelopmentStorage=true",
          "FUNCTIONS_WORKER_RUNTIME": "dotnet"
      }
  }
  </code></pre>
  
  <p>And the error I get when I start the debugger is this
  <a href="https://i.stack.imgur.com/Hazmc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hazmc.png" alt="enter image description here"></a></p>
  
  <p>This is output:</p>
  
  <pre><code>[11/8/2019 10:29:04 AM] A host error has occurred during startup operation '8b80bc94-2b98-408b-895f-c5697430acfd'.
  [11/8/2019 10:29:04 AM] Microsoft.Azure.WebJobs.Extensions.DurableTask: Value cannot be null.
  [11/8/2019 10:29:04 AM] Parameter name: hostConfiguration.
  Value cannot be null.
  Parameter name: provider
  </code></pre>