Azure Web PubSub trigger for Azure Functions in JAVA

Martin Body 20 Reputation points
2023-09-21T15:01:44.34+00:00

Hello,

I am searching information if Azure Web PubSub supports trigger for Azure Functions in JAVA.

Question1: Is this configuration is supported?

We have a Web PubSub and Azure Function in JAVA and trying to configure the Web PubSub service Event Handler. In other words we are trying to forward events from Web PubSub to JAVA Azure serveless function. Clients are sending Websocket messages.

We copied "connection string" from Web PubSub and then we navigated to Function App settings in Azure Portal -> Settings -> Configuration. We added a new item under Application settings, with name equals WebPubSubConnectionString and pasted Web PubSub connection string as a value according to this tutorial: https://learn.microsoft.com/en-us/azure/azure-web-pubsub/quickstart-serverless?tabs=javascript Our problem is that there is no "System Key" in Azure Function (Function App resource -> App keys -> System keys) which is necessary for creation of event handler.

Question2: Is there any other service in Azure which fulfil following conditions?:

  • Serverless JAVA app
  • support for Websockets communication

Thank you.

Martin

Azure Web PubSub
Azure Web PubSub
An Azure service that provides real-time messaging for web applications using WebSockets and the publish-subscribe pattern.
66 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,352 questions
Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
282 questions
{count} votes

Accepted answer
  1. Liangying Wei 756 Reputation points Microsoft Employee
    2023-10-11T03:52:00.36+00:00

    Event handler follows the CloudEvents HTTP protocol, so using HTTPTrigger also works. For Java WebPubSubTrigger is not yet supported, but using HttpTrigger is also pretty simple, here is a sample using HttpTrigger to write a chat similar to the one in the tutorial: https://github.com/Azure/azure-webpubsub/tree/main/samples/functions/java/simplechat

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Grmacjon-MSFT 16,441 Reputation points
    2023-10-06T22:54:25.1533333+00:00

    Hello @Martin Body thanks for your patience. Yes it appears your scenario is not currently supported. However, I am still waiting to hear back from the Azure Web PubSub team to see if there is a possible work around or if this is on the roadmap to be supported in the future. I will update my answer as soon as I hear back from them.

    Best,

    Grace

    0 comments No comments