Good to hear it works.
So, sometimes doing nothing pays off.
It takes a while for Azure to set everything up in the background. Stuff has to scale up etc.
If CosmosDB is your goal, why not use a proper IoT Hub and route directly to CosmosDB?
The architecture you now choose (event hub -> stream Analytics -> cosmosdb) is more expensive, less secure, less flexible, and not on par with the Azure IoT Reference architecture ((free) IoTHub -> CosmosDB or (free) IoTHub -> eventhub -> (free) ADX).
In real-life solutions, ingesting real-time IoT data, ADX is the winner because of scale, query speed, and many other reasons.
Regarding visualization, why put it in cosmosDB?
You have seen the PowerBI output on Azure Stream Analytics?
Or the ADX Dashboards?
Our lecturer said we should not use IoT data, she wanted us to generate our own data and visualise it.
None of the tools I proposed generated data, that's something you have to do.
Good luck :-)
If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.