The Problem: From CRM, we need to call a webservice and display the results using a webresource. I would like this call to be made using ajax so the UI is somewhat user friendly/responsive. The webservice is hosted in Azure and can either be an Http triggered function or an App Service web API.
I have seen many examples of creating services in Azure that can authenticate into and access CRM data. But I haven't been able to find examples where CRM authenticates into Azure. I am looking for something along these lines MSAL.js
You can do this in js webresource using Ajax call to invoke Azure hosted REST api & consume that response in there.
Similar discussion in community
You can use MSAL.js to acquire token & use it in authorization header with the below sample code.