title: How to fix "No event hub receiver named <name>"
body: <p>I am writing an azure webjob which reads events from eventhub using NET Core 3.1.
  I have a config file as below:</p>
  
  <pre><code>{
    "JobHostConfig": {
      "DashboardConnectionString": "",
      "StorageConnectionString": "xx"
    },
    "EventHubConfig": {
      "EventHubConnectionString": "xx",
      "EventHubName": "xx",
      "EventProcessorHostName": "xx",
      "ConsumerGroupName": "xx",
      "StorageConnectionString": "xx",
      "StorageContainerName": "xx"
    }
  }
  </code></pre>
  
  <p>In the Main method, I call ConfigureServices method which looks something like:</p>
  
  <pre><code>        var builder = new ConfigurationBuilder()
              .SetBasePath(Directory.GetCurrentDirectory() + $"\\..\\..\\..\\ConfigFiles")
              .AddJsonFile($"applicationConfig.json", optional: true, reloadOnChange: true)
              .AddJsonFile($"applicationConfig.{environment}.json", optional: true, reloadOnChange: true);
  
          Configuration = builder.AddEnvironmentVariables()
                                 .Build();
  
          services.AddSingleton&lt;IConfigurationRoot&gt;(Configuration);
          services.AddSingleton&lt;IConfiguration&gt;(Configuration);
          services.AddMvcCore();
          services.AddSingleton(GetInstance&lt;EventHubConfig&gt;());
          services.AddSingleton(GetInstance&lt;JobHostConfig&gt;());
  </code></pre>
  
  <p>I confirmed that at runtime configs are getting populated in <code>Configuration</code> only like this: <code>Configuration["EventHubConfig:EventHubName"]</code>. But I also debugged that environment variables have not been set and its value is <code>null</code>.</p>
  
  <p>So when I do:
  <code>ProcessEvent([EventHubTrigger("%EventHubName%", ConsumerGroup = "%ConsumerGroupName%", Connection = "%ConnectionString%")] EventData eventData)</code> I get that <code>%EventHubName%</code> is not resolved.</p>
  
  <p>Also, when I hard-code the values of these then I get: No event hub receiver named.</p>
  
  <p>Can someone suggest what is wrong with my registration?</p>
  
  <p>Furthermore, I replaced the values with string in EventHubTrigger, and I get Value cannot be null. Parameter name: receiverConnectionString</p>