I have a single API that sits behind an Azure API Management (APIM). Additionally, I have a few independent applications that need to consume this API via APIM (Lets say, application A, and application B - both of which are function apps). My question is, do I create two separate sets of APIs in APIM for each function app to consume the single API? Or should I send them through the same APIM API? What is best practice? I've searched Microsoft but haven't been able to definitively find anything yet.
Furthermore, would it make a difference if they were two SPAs consuming the API? (Let's say a consumer spa app, and an administration spa app)
The general approach is to structure you APIs in APIM around how they will be consumed. Splitting single API surface into separate products/APIs/operations in APIM allows you to specify different policies, access requirements, see those calls separately in logs and analytics e.t.c. So if in your scenario you do not have a need to distinguish between your two apps, there would be no need to split anything.
But say you want one app to use certificate authentication and another to rely on subscription keys - that would be a good case for having two products in APIm.
Similarly, say one app only needs one set of operations and another needs different one - this is a strong case for splitting into multiple APIs.
If all else fails, splitting APIs into logical blocks still makes sense. Depending on your subject area you may have: