GoldieLocks
GoldieLocks

Reputation: 933

Is there a way of having the Azure Function Web PubSub trigger fire only for certain groups?

I would like to setup an Azure Function so that it has a trigger on a Web PubSub hub but only gets triggered when messages are sent to a certain group on that hub. Is that possible? All of the examples I can see don't have any concept of groups on the trigger.

Ideally where I want to get to is to be able to subscribe to certain groups at runtime. For example, in the same function project a http triggered function fires and as part of that execution I add my pubsub triggered function to a group, which then fires when messages are sent to that group.

Is that even possible?

Upvotes: 0

Views: 243

Answers (1)

PramodValavala
PramodValavala

Reputation: 6647

The Groups in Azure Web PubSub are used to target a set of user connections rather than the service, unless you have a service that is connecting to your Web PubSub as a client.

Your service won't really receive any requests that it sends to its users (or connections/groups) but only messages sent from them to it, the service.

For any service-to-service connection, you are usually better of using a Message Broker like Azure Service Bus instead.

Upvotes: 0

Related Questions