Share via

Limit Consumption level api to authenticated users

Todd 1 Reputation point
2020-09-10T23:09:32.287+00:00

Is it possible to limit the Consumption (serverless) level api to authenticated users from AAD B2C?

Thanks

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

Microsoft Security | Microsoft Entra | Microsoft Entra External ID

1 answer

Sort by: Most helpful
  1. JamesTran-MSFT 37,256 Reputation points Microsoft Employee Moderator
    2020-10-12T17:30:04.837+00:00

    @Todd
    Thank you for the quick response!

    I walked through this Stack Overflow thread and was able to authenticate my Function App using my B2C user, I'll post the details from the link below.

    Steps:

    1- Create an Azure Functions App and write down the URL i.e. https://jatrantest.azurewebsites.net
    2- Within your AzureAD B2C tenant:

    -Navigate to your AzureAD B2C User Flows -> Select your sign-in flow -> Select "Run user Flow" -> Copy the metadata endpoint URL
    31781-image.png

    3- Within your Function App:
    -Select Authentication / Authorization on the left blade -> Turn on "App Service Authentication" -> Select Azure Active Directory -> Select "Advanced"

    Client ID - This is the Application ID of your B2C application  
    Issuer Url - This is the metadata endpoint URL  
    Client Secret - This is optional, however, you can create a secret within your B2C app and paste it here.  
    

    -Select "OK" -> Select Save

    4- To test out functionality in your B2C tenant
    -Select the Sign-in Flow -> Select "Run user Flow" -> Select the Reply URL you added earlier (/.auth/login/aad/callback) -> Run user flow
    31658-image.png
    31782-image.png

    If you have any other questions, please let me know.
    Thank you for your time and patience throughout this issue.


    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.