I am trying to create a POC for an end to end Clickstream analytics solution using Azure products. The plan would be:
- write a simple JS that captures the event I want to send to Azure. This will be part of the client side browser. Let's say an event might look like this
{
"event_name": "page_view",
"page_url": "https://stackoverflow.com/questions",
"time_stamp": "1692869137221"
}
- use client side JS to send the event to Azure Event Hub
- use Azure Functions to then store the event in Azure Blob
- pull data from the Azure Blob and store them in a database
I am fine with point 1,3,4 but I struggle a bit to get my head around point 2 and how to pass the data from the client browser to Event Hubs following security best practices as of course I don't wanna expose Event Hubs credentials.
I am sure Azure has got something that doesn't imply you building your own API or endpoint before passing the data to Event Hub.
Has anyone done anything similar? Basically the main issue I have is:
How can you send a json object containing web analytics data from the client browser to Azure Event Hub in a secure way using JS? Ideally using Azure products only
Thanks,
Davide
index.jsindex.htmlIn Local
In Azure: