1
votes

I've got a time-triggered Azure Function through which I push some message in my Azure Service Bus topic. Now, the expectation is whenever a message is received in the topic it will trigger another function which is a topic-triggered function. Unfortunately, when I check for messages in the topic subscription through Service Bus Explorer tool, it doesn't show any message received. Also I can see this error in the function console : The 'myFunc' function is in error: The binding type(s) 'serviceBusTrigger' are not registered. Please ensure the type is correct and the binding extension is installed

I'm not sure where am I going wrong here. I've defined my topic-triggered function like this:

   [FunctionName("myFunc")]
                public async Task Run([ServiceBusTrigger("topic-name", "subs-name", Connection = "ServiceBusConnectionString")]string message, ILogger log)
                { ... }

Note that I've got the latest versions of Microsoft.Azure.WebJobs & Microsoft.Azure.WebJobs.ServiceBus installed(however dont know why both shows a warning). Is it because of any issue with the versions?

enter image description here

My host.json:

{
  "version": "2.0",
  "logging": {
    "logLevel": {
      "fun_name": "Information"
    }
    }
 }
1
What is the version of function you are using? - Bowman Zhu
@BowmanZhu it's v2 - The Inquisitive Coder
Show your host.json - Tim P.
@TimP. added in the main contect - The Inquisitive Coder
Can you show the .csproj file of your function app? - Bowman Zhu

1 Answers

1
votes

This is the .csproj file on my side, it works fine on local.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <AzureFunctionsVersion>v2</AzureFunctionsVersion>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="4.1.0" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.29" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

enter image description here

There should be no problems, you may face component conflicts.