0

I've got pubsub with Redis working locally. I can deploy to Azure and see messages being created in the topic subscription.

If I query /dapr/subscribe I get [{"topic":"TestGotUser","pubsubName":"pubsub","route":"PubSubEventGotUserSubscriber"}] so it's wired as expected. My problem is the consumer is silently just not retrieving messages

app.MapPost("/PubSubEventGotUserSubscriber", async (DaprTestApis handler, MessageEvent item) =>
{
  await handler.PubSubEventGotUserSubscriber(item);
}).WithTopic("pubsub", "TestGotUser";

// and handler
public async Task PubSubEventGotUserSubscriber(MessageEvent item)
{           
  _logger.LogInformation($"Received Message: User is {item.Message}");
  await Task.CompletedTask;
}

the endpoint is never hit.

I'm using Managed Identities and the mi has "Azure Service Bus Data Receiver " and "Azure Service Bus Data Sender "

What could I be missing? I guess something in Azure. I am totally stuck

Classic Neil
  • 97
  • 1
  • 6
  • Have you seen this sample? https://github.com/Azure-Samples/pubsub-dapr-nodejs-servicebus It shows an end to end Dapr PubSub + Azure Service Bus working sample. Perhaps you can review the IaC/App source to see what part you're missing. – GordonBy May 17 '23 at 14:50
  • @GordonBy that's a good suggestion, but a still can't see the missing piece – Classic Neil May 17 '23 at 15:37

1 Answers1

0

The managed identity also creates topics and subscriptions, so needs more than 'Data Sender'.

We went with 'Azure Service Bus Data Owner' (in dev) but this should really be more fine grained in production ('Create or Update Topic' etc.)

Classic Neil
  • 97
  • 1
  • 6