title: Azure Durable Functions - where's the HostBuilder equivalent?
body: <p>I'm using an <a href="https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview?tabs=csharp" rel="nofollow noreferrer">Azure Durable Function</a> to orchestrate other functions, currently contained in the same project. I want to configure services and logging for those orchestrated functions. How can I do that?</p>
  <p>Here is some more detail:</p>
  <p>In a &quot;normal&quot; Azure Function I have a <code>Program.cs</code> and a <code>Main</code> method with the following code that sets up the environment for the function execution:</p>
  <pre><code>var host = new HostBuilder()
      .ConfigureFunctionsWorkerDefaults()
      .ConfigureLogging(loggingBuilder =&gt; { loggingBuilder.SetMinimumLevel(LogLevel.Trace); })... etc. pp.
  </code></pre>
  <p>Using the <code>HostBuilder</code> I can add additional logging providers, add caching services etc. Those services are then injected via the constructor of the Azure Function.</p>
  <p>Now in comparison when creating a Durable Function project via the VS Code &quot;Durable Function Orchestration&quot; template there is no <code>Program.cs</code>, no <code>HostBuilder</code> and no constructor. There are just some static methods representing the orchestrator and an orchestrated function.</p>
  <p>As there is no out-of-the-box <code>HostBuilder</code> in the &quot;Durable Function Orchestration&quot; template - how does the <code>HostBuilder</code> equivalent look like for Durable Functions? Whats the pattern or convention here? Do I write it myself? Or is there some instance floating around or initialization I can hook into? Or should orchestrated functions be put into separate Azure Function projects where I can make use of the <code>HostBuilder</code>?</p>
  <p>Any hints are appreciated.</p>