Azure Function using a topic trigger: The messaging entity could not be found.

Rob Collie 21 Reputation points
2021-08-11T07:15:01.07+00:00

I have a test function that simply gets triggered by a message to a topic:

    [FunctionName("TestFunction")]  
    public static void Run([ServiceBusTrigger("test", "%Subscription%", Connection = "ServiceBusConnectionString")]string myQueueItem, ILogger log)  
    {  
        log.LogInformation($"C# ServiceBus queue trigger function processed message: {myQueueItem}");  
    }  

When running the function in Azure, I get (with project names hidden):

2021-08-11T07:03:58.094 [Error] Message processing error (Action=Receive, ClientId=MessageReceiver4test/Subscriptions/<removed>, EntityPath=test/Subscriptions/<removed>, Endpoint=<removed>.servicebus.windows.net)Microsoft.Azure.ServiceBus.MessagingEntityNotFoundException : The messaging entity '<removed>:Topic:test|<removed>' could not be found.

I've literally done this with a copy-and-pasted subscription name, topic name and service bus connection string.

122208-temp.png

Are there some extra steps I need to take?

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
641 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,134 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,168 questions
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,536 Reputation points
    2021-08-11T08:18:41.423+00:00

    @Rob Collie Thanks for sharing more details. As we can see that there was no subscription under the topic the error message is expected behavior. You need to create a new subscription and configure the same in your function app.
    To learn more on topic and subscription please refer to this document.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.