I added this one single, specific reference:
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Kafka" Version="3.3.2" />
I'm able to add this one function to recieve the error, and comment it out to have it go away:
[Function("hello_kafka")]
public async Task HelloKafka(
[KafkaTrigger(
"localhost:9092",
"hello",
ConsumerGroup = "hello"
)]
string input,
FunctionContext context)
{
Console.WriteLine(input);
await Task.CompletedTask;
}
Here is the actual error:
Function Runtime Version: 4.0.1.16815
A host error has occurred during startup operation '4ce2502e-0d06-4e59-be75-2606b814812a'. Confluent.Kafka: Failed to load the librdkafka native library. Value cannot be null. (Parameter 'provider')
error MSB3073: The command "func host start" exited with code 1.
This was brutal but the answer is that its just straight up not loading the binary correctly and after digging through the docs it appears I had to add this environment variable:
Docker Compose Example
Note: the base path
/home/site/wwwroot/
corresponds to the default WORKDIR within the Dockerfile generated by Visual Studio, but this path may differ for custom Dockerfile builds.