Troubleshooting "Unauthorized" errors when calling Azure API Management with B2C

hampton123 1,010 Reputation points
2023-07-19T16:29:41.5333333+00:00

Currently I've been following this tutorial to integrate Azure API Management with B2C: https://learn.microsoft.com/en-us/azure/api-management/howto-protect-backend-frontend-azure-ad-b2c.

I have the system for B2C working, however when I call the API through pressing the "Call API" button after logging in, I receive an error "GET {API link}" 404 (Not Found)". When I load the API link in the next tab, it states a 401 unauthorized status code. I'm not sure how to address this issue.

Please let me know if I need to provide any additional context.

EDIT: I neglected to mention that the HTML itself states "SyntaxError: Unexpected end of JSON input" as the error. The 404 GET error is from inspecting the page and looking into the error.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,650 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,005 questions
Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,571 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
18,647 questions
{count} votes

Accepted answer
  1. MuthuKumaranMurugaachari-MSFT 21,646 Reputation points
    2023-08-09T15:35:47.98+00:00

    Hunter B Thanks for your patience and sharing it with us.

    Update for the community:

    Initially when following the tutorial, App registrations were not created under Azure AD B2C. Then after assigning necessary permissions and troubleshooting, Hunter B figured out that Azure Function name was created incorrectly i.e., HttpTrigger1 vs hello in the tutorial. Hence, the API call was made incorrectly and returned the above error.

    He corrected the function name and it worked successfully.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful