web app shows data only when user in it, resets when opened again

TITAN 46 Reputation points
2023-02-09T11:05:10.9433333+00:00

Hi,

I have an azure web app running, showing live data from my IoT hub, based on this article.

When I'm in the web-app, the data updates and works well, but if I refresh the page, the data resets.

I want it to run the data all the time, so if I want to look on the history of the data, I will be able to.

I tried to set always on settings (via the azure portal) - ON, but it didn't help. (the rest of the deployment and settings of the web app - I did via the Azure CLI).

Thank you,

R

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,235 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,068 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sander van de Velde | MVP 34,766 Reputation points MVP
    2023-02-09T12:46:15.7866667+00:00

    Hello @TITAN,

    the sample application you use just shows live data.

    All incoming messages are just drawn on the page, there is no historical storage.

    You can try to change the code so messages are both put in some kind of storage and pages get live data. Once a page is opened/refreshed, the latest historical data (last x hours of messages) is gathered and represented. After that, the newest messages are added to it.

    You can also check out more conventional ways to represent data like Grafana.

    Also, check out PowerBI in the cloud. It has a convenient built-in temporary storage accessible using Azure Stream Analytics.

    Either way, you need to think of adding an extra step between receiving incoming data and (temporarily) persisting historical (warm path) data before you represent it.


    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.