Open Metal-Mighty opened 6 months ago
@Metal-Mighty the portal has a synchronization scheduler. I could take some minutes to reflect Azure IoT Hub changes to the portal directly.
I encourage you to not change devices directly on IoT Hub while using the portal to limit the apparition to this issue.
By the way, the refresh timeout is by default set to 5 minute. You can adapt it in your settings to reduce it in case it is necessary: (See: https://cgi-fr.github.io/IoT-Hub-Portal/stable/dev-guide/#application-settings:~:text=Job__SyncDatabaseJobRefreshIntervalInMinutes for more details).
Ar you able to reproduce it after the sync timeout?
Hi @kbeaugrand ! I can confirm it's still an issue after a sync timeout since I realized this afternoon that device models (in IoT Hub > Configurations + Deployments) were missing, even though they were in the portal since Friday. Sadly this comes after having to recreate the IoT Hub because it wasn't properly created on Azure, and it was the only thing to do according to our contact at Microsoft, so not something we could have done in the Portal ;)
What I could have done would be to delete everything from the Portal prior to deleting the IoT Hub, but I didn't think about it back then!
We're having the same issue today in another use case: We have and IoT Hub, and an Azure-hosted IoT Portal connected to it and a number of devices (and edge devices) + their associated models declared. We started a Portal locally on a development machine with a local db (= not the one used by the portal on Azure), but connected to the same Azure IoT Hub as our Azure Portal.
=> The local Portal didn't sync the data from IoT Hub into the development portal's DB. Only the Dashboard has correct information (and we did wait much more than 5 minutes 😉) The dev instance is started using the code in the main branch.
I In this case, I assume that this problem occurs because device models are not created in the development environment.
Could you check that all models are also created in the development environment because they should be present to be able to synchronize their devices.
Note that since models are not a supported feature on Azure IoT hub, they could not be synchronized anyway.
Expected Behavior
Since the introduction of the database cache for the portal, I expect it to stay up to date with what's actually in the IoT Hub on Azure (models, devices, etc).
Current Behavior
The portal doesn't fully synchronize with IoT Hub. It adds elements from IoT Hub to its db, but if elements are deleted directly from the IoT Hub without using the portal, elements stay in the DB and sometimes can't even be removed from the portal. Same goes if the IoT Hub is deleted and created again: The portal still has the old data. It can also lead to errors in automated deployment tasks: We use the API to check for existing models and we create or update them depending on the result, but since it doesn't return the actual Azure data, it doesn't always properly create or update elements. This is also especially problematic on elements with unique IDs, connection keys, etc. (e.g., Edge Devices credentials).
Steps to Reproduce
Context (Environment)
Portal version: 4.13.2.170 LoRaWAN Stack version: N/A
Logs
Additional Information