Azure / azure-webjobs-sdk

Azure WebJobs SDK
MIT License
737 stars 358 forks source link

Improve comments in SampleHost to be explicit about what connection strings are required to run it as-is #2285

Open grahamehorner opened 5 years ago

grahamehorner commented 5 years ago

SampleHost fails to run

Repro steps

Provide the steps required to reproduce the problem

  1. set SampleHost as startup
  2. run SampleHost

Expected behavior

should successfully run

Actual behavior

exceptions


> fail: Host.Startup[0]
>       Error indexing method 'Functions.ProcessEvents'
> Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexingException: Error indexing method 'Functions.ProcessEvents' ---> System.ArgumentNullException: Value cannot be null.
> Parameter name: receiverConnectionString
>    at Microsoft.Azure.WebJobs.EventHubs.EventHubOptions.AddReceiver(String eventHubName, String receiverConnectionString) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.EventHubs\Config\EventHubOptions.cs:line 163
>    at Microsoft.Azure.WebJobs.EventHubs.EventHubTriggerAttributeBindingProvider.TryCreateAsync(TriggerBindingProviderContext context) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Extensions.EventHubs\Triggers\EventHubTriggerAttributeBindingProvider.cs:line 66
>    at Microsoft.Azure.WebJobs.Host.Triggers.CompositeTriggerBindingProvider.TryCreateAsync(TriggerBindingProviderContext context) in C:\Users\GrahameHorner\source\repos\azure-webjobs-sdk\src\Microsoft.Azure.WebJobs.Host\Triggers\CompositeTriggerBindingProvider.cs:line 22
>    at Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.IndexMethodAsyncCore(MethodInfo method, IFunctionIndexCollector index, CancellationToken cancellationToken) in C:\Users\GrahameHorner\source\repos\azure-webjobs-sdk\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs:line 160
>    at Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.IndexMethodAsync(MethodInfo method, IFunctionIndexCollector index, CancellationToken cancellationToken) in C:\Users\GrahameHorner\source\repos\azure-webjobs-sdk\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs:line 137
>    --- End of inner exception stack trace ---
>    at Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.IndexMethodAsync(MethodInfo method, IFunctionIndexCollector index, CancellationToken cancellationToken) in C:\Users\GrahameHorner\source\repos\azure-webjobs-sdk\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs:line 145
>    at Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer.IndexTypeAsync(Type type, IFunctionIndexCollector index, CancellationToken cancellationToken) in C:\Users\GrahameHorner\source\repos\azure-webjobs-sdk\src\Microsoft.Azure.WebJobs.Host\Indexers\FunctionIndexer.cs:line 73
> 

Known workarounds

Related information

brettsam commented 5 years ago

You need to have the service bus connection string set up (or you can just remove .AddServiceBus())-- I'm going to repurpose this issue to "beef up the sample comments". I agree we should be explicit about what's required to get this to run.