REF comments above
For reference in no particular order
Google have a nice short and balanced doc on API key security here https://cloud.google.com/endpoints/docs/openapi/when-why-api-key(the concepts here are applicable to any architecture or cloud)
There's a couple of simple [SPA] web app examples from MS that include B2C
https://learn.microsoft.com/en-us/azure/active-directory-b2c/configure-authentication-sample-react-spa-app
https://github.com/Azure-Samples/ms-identity-b2c-javascript-spa
In both cases the app itself would be bootstrapped from a static web host/CDN (or static website on Storage) and the first thing the user would do is sign up or sign in. Thereafter API interaction is based on the access token derived from the login (id) token. An API key might be derived from the login (id) token claim or config
For completeness
This is a nice APIM companion doc to the older API OWASP list (we're working on an update as the OWASP top 10 has been updated) . https://learn.microsoft.com/en-us/azure/api-management/mitigate-owasp-api-threats
This is a nice doc on auth and authz concepts in APIM https://learn.microsoft.com/en-us/azure/api-management/authentication-authorization-overview
Hope this helps