Create personalized marketing solutions in near real time

Azure Cosmos DB
Event Hubs
Machine Learning
Stream Analytics

Solution ideas

This article is a solution idea. If you'd like us to expand the content with more information, such as potential use cases, alternative services, implementation considerations, or pricing guidance, let us know by providing GitHub feedback.

This architecture shows how you can create a solution personalizing offers with Azure Functions, Azure Machine Learning, and Azure Stream Analytics.


Architecture diagram: personalizing offers with machine learning and near real time analytics.

Download a Visio file of this architecture.


  • Event Hubs ingests raw click-stream data from Azure Functions and passes it on to Stream Analytics.
  • Azure Stream Analytics aggregates clicks in near real time by product, offer, and user. Writes to Azure Cosmos DB and also archives raw click-stream data to Azure Storage.
  • Azure Cosmos DB stores aggregated data of clicks by user, product, and offers user-profile information.
  • Azure Storage stores archived raw click-stream data from Stream Analytics.
  • Azure Functions takes in user clickstream data from websites and reads existing user history from Azure Cosmos DB. These data are then run through the Machine Learning web service or used along with the cold-start data in Azure Cache for Redis to obtain product-affinity scores. Product-affinity scores are used with the personalized-offer logic to determine the most relevant offer to present to the user.
  • Azure Machine Learning helps you design, test, operationalize, and manage predictive analytics solutions in the cloud.
  • Azure Cache for Redis stores pre-computed cold-start product affinity scores for users without history.
  • Power BI enables visualization of user activity data and offers presented by reading in data from Azure Cosmos DB.


Scenario details

Personalized marketing is essential for building customer loyalty and remaining profitable. Reaching customers and getting them to engage is harder than ever, and generic offers are easily missed or ignored. Current marketing systems fail to take advantage of data that can help solve this problem.

Marketers using intelligent systems and analyzing massive amounts of data can deliver highly relevant and personalized offers to each user, cutting through the clutter and driving engagement. For example, retailers can provide offers and content based on each customer's unique interests, preferences and product affinity, putting products in front of the people most likely to buy them.

This architecture shows how you can create a solution personalizing offers with Azure Functions, Azure Machine Learning, and Azure Stream Analytics.

Potential use cases

By personalizing your offers, you'll deliver an individualized experience for current and prospective customers, boosting engagement and improving customer conversion, lifetime value, and retention.

This solution is ideal for the retail and marketing industries.

Next steps

See the product documentation:

Try a learning path:

Read other Azure Architecture Center articles: