0

I want to create an app to update the azure IoT edge module twin configuration.

which is the best option? use the 'azure-iothub' package to update the twin directly from react app.

create an express node server and react front end, use the 'azure-iothub' package in the express app.

2 Answers 2

0

Well, if you do things like this in the React front end, won't you have security issues because the credentials could be compromised and APIs called with those?

If you did that in the backend node server, you could secure the credentials better and run some business rules before you use those credentials to call the APIs.

0

The best option for updating the Azure IoT Edge module twin configuration from a React app would be to create an Express Node server and use the 'azure-iothub' package in the server-side application.

Here's why:

Security: If you update the twin directly from the React app, you will have to expose the device connection string and other sensitive information to the client-side application. This can be a security risk as anyone with access to the React app can potentially make changes to the twin configuration. On the other hand, using an Express Node server will allow you to keep the sensitive information on the server-side and only allow authorized users to make changes to the twin configuration.

Performance: The twin updates can be a complex operation that requires a lot of processing power and resources. If you do the twin updates directly from the React app, it can slow down the app performance and make it less responsive. By using an Express Node server, you can offload the processing to the server side and ensure that the app performance is not impacted.

Scalability: If you have multiple users accessing the React app, then doing the twin updates directly from the app can be challenging to scale. Using an Express Node server, you can handle multiple requests simultaneously and ensure that the twin updates are processed efficiently.

In summary, using an Express Node server and the 'azure-iothub' package in the server-side application would be the best option for updating the Azure IoT Edge module twin configuration from a React app.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.