JamesRandall / FunctionMonkey

Write more elegant Azure Functions with less boilerplate, more consistency, and support for REST APIs. Docs can be found at https://functionmonkey.azurefromthetrenches.com
MIT License
294 stars 50 forks source link

[Compilation Error] Blob Storage function to Service Bus output binding #134

Closed lbrecheisen closed 2 years ago

lbrecheisen commented 4 years ago

Using a blob function with an output binding to service bus, I'm receiving the following error:

Error compiling function: BlobFnTest.cs(48,37): error CS0103 The name 'pluginFunctions' does not exist in the current context

I'm utilizing the MediatR implementation.

The following code should reproduce the error.

Command:

    public class TestCommand : IRequest<string>, IStreamCommand
    {
        public Stream Stream { get; set; } = Stream.Null;
        public string? Name { get; set; }
    }

Handler:

    internal class TestHandler : IRequestHandler<TestCommand, string>
    {
        public Task<string> Handle(TestCommand command, CancellationToken ct)
        {
            return Task.FromResult("test");
        }
    }

Configuration:

    .Storage(builder => builder
        .BlobFunction<TestCommand>("test-container/{name}")
            .OutputTo.ServiceBusTopic("test-topic"))

Packages Extensions:

    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="4.0.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.10" />

Function Monkey Version: 4.0.56-beta.4 Dotnet Version: 3.1 Azure Function Core Tools Version: 3.0.2106 Editor: VSCode OS: Mac

rturnq commented 4 years ago

You have probably moved on by now, but I ran into this same issue. I dug into it and it appears pluginFunctions is not defined in the stream blob storage function template like it is in others. I created a pull request to resolve the issue: #163