How do you configure the Event Handler in Web PubSub service side? The function will be triggered when there's client message through client WebSocket connection.
Client --> Service -->(Event Handler) --> Server/Function -->(REST API) Service --> Clients
See HERE to work with function bi-direction communication sample. And another simpler notification sample doesn't need event handler can be checked HERE which is doing similar things like your console app.
Your second console app is working as a server that directly sends messages through Rest API. So event handler is not needed.
Server --> Service --> Clients
Besides, there's general Reference Doc about Function extensions. Please take a look to understand how's it working.