When to use isolated SPFX webpart?

Copper Contributor

I am creating a SPFX webpart that will consume an Azure Function and the Azure Function is configured for AAD authentication. Very similar to the steps described in this blog post by @Vardhaman Deshpande. I am using the same web api permissions as described in the blog (user_impersonation and Windows Azure Active Directory, User.Read).

 

My question is whether I should use isolated webpart option? The Azure Function is exposing a very limited functionality and the site/page where the SPFX webpart will be hosted is managed by our team so no risks of sniffing access tokens. What are the risks when not using isolated webpart? If the only risk that other SPFX webpart can consume this specific Azure Function?

 

Thx!

 

Update: Link to blogpost added.

1 Reply
Hi @Suleman
SPFx web parts which Web API using WebApiPermissionRequests requires SharePoint / Global Admin approval through admin center. Once approved, other web parts can use similar permissions even though they are not in particular site collection. Using Isolated SPFx web part is solution to that problem. When Isolated SPFx web part request Web API permissions, permissions are only granted to that web part through unique ID of that SPFx web part by Azure AD. All calls to Web API only receive valid access token if Web API calls goes through that same SPFx web part. In that way, Web API permissions approval is Isolated to specific web part.