- GitHub Repository: https://github.com/wizzard262/AzureServiceBusDemoMvc
- Build & Deploy from Azure DevOps Pipeline: https://dev.azure.com/jones-steve/AzureServiceBusDemo/_build
- MVC webpage hosted on Azure: https://azureservicebusdemomvc-heh2hzd9b9akg9fk.ukwest-01.azurewebsites.net/ (Resource: AzureServiceBusDemoMvc)
- Azure Service Bus namespace: wizzard262 Queues: demo-asb-queue & demo-asb-queue-triggers-azure-function
Azure Function Service Bus Trigger / Signal R Demo
1. SignalR negotiation and open Transport connection
- Initiate a negotiation request to the SignalR endpoint.
- Receive: ConnectionId, Transport (WebSockets), SignalR service URL
2. Send – Adds a new message to queue
Note: this is currently vulnerable to injection: <div><img src=x onerror="alert('Injected JS executed')"></div>3. Azure Function (triggered by Azure Service Bus queue message) picks up and processes the message
- Calls a method on the SignalR Hub (a server-side element in this MVC project)
- SignalR Hub broadcasts the emessage to all subscribers
- The Azure function is hosted at: https://weatherfunctionopenmeteo.azurewebsites.net/api/GetAzureServiceBusMessage
4. SignalR javascript in this page picks up the message and parses it into the HTML of this page below
Signal R message from ASB: