Using Entra ID-protected APIs
In an enterprise scenario, it is quite common to consume custom APIs protected by Entra ID, for instance, to call an Azure function triggering an external business process. Like the Microsoft Graph API, SPFx provides a way to easily consume such APIs to avoid having to carry out the authentication process manually.
To demonstrate this use case, we will now assume the product information from our products inventory is now retrieved from an Azure function app called demospfxfunction instead of a SharePoint list.
Note
The goal of this book is not to explain how to create an Azure function or configure an app service. The following sections only explain the major configuration steps required to integrate your application with SPFx.
In the next section, we detail its configuration and usage with SPFx.
Configuring an Azure function with EasyAuth
From the Azure portal, we first create a function called GetProducts of the HTTP trigger type, which...