Reputation: 3253
I have created a brand new .NET Core 3.1 Azure Function project using the Visual Studio template
I am using V3 of the functions, i.e. the version created by the template
I have the latest VS - 16.10.2
Straight away, it fails with ServiceBusTrigger and Connection not found?
using System; using Microsoft.Azure.WebJobs; using Microsoft.Azure.WebJobs.Host; using Microsoft.Extensions.Logging;
namespace AzureFunctionTest
{
public static class Function1
{
[FunctionName("Function1")]
public static void Run([ServiceBusTrigger("AzureFunctionTest", "Research Subscription", Connection = "eventbus-connection")]string mySbMsg, ILogger log)
{
log.LogInformation($"C# ServiceBus topic trigger function processed message: {mySbMsg}");
}
}
}
Really strange how a template from MS itself does not work and a bit concerning this fails on the first hurdle!!
Here are the relevant parts of my project file
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.1.2" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.11" />
</ItemGroup>
Azure.Messaging.ServiceBus seems to be the latest package and the one recommended to use
What am I missing?
Paul
Upvotes: 1
Views: 897
Reputation: 10839
You should be using Microsoft.Azure.WebJobs.Extensions.ServiceBus
package. Link.
You can read this official documentation for further information.
Upvotes: 4