0

Any advice about how to connect a spfx web part using the react template to an azure sql database.

But can't seem to find a clear example. I'd be looking to bind controls e.g. Combo boxes to a sql azure sql table

Any help will be greatly appreciated.

closed as primarily opinion-based by Gaurravs, Robert Lindgren, Asad Refai, Mohamed El-Qassas MVP Nov 6 '18 at 14:00

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

2

You need to remember that anything that runs client side is able to be sniffed out by the end user, so any front end code connecting to a database would necessarily expose the connection details back to the end user - the keys to the kingdom, if you will. This is an egregious security risk.

Best practice is to deploy a custom secured web service, and have the web part call that instead.

There's a lot of ways to achieve this, but very common is to use Azure Functions and/or ASP.Net secured with Azure Active Directory: https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/guidance/connect-to-api-secured-with-aad

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