Adding Entra ID authentication to Python Dash web app in Azure App Service

Guido Nahuel Franco 40 Reputation points
2024-01-05T18:55:16.7466667+00:00

I have deployed a web app built in Python using the Dash library to Azure App Service. I want to add authentication using Entra ID, but I am getting a 403 error when I try to access the web app and I am not redirected to the Microsoft login page. I have configured the issuer url as https://login.microsoftonline.com/<tenant id>/v2.0 and entered the app id from the app registration created on another Entra ID tenant in the Azure portal. What could be causing the error?

Attached are images of the error and configuration.

User's image

User's image

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 ID
{count} votes

Answer accepted by question author
  1. Grmacjon-MSFT 19,491 Reputation points Moderator
    2024-01-11T05:08:12.09+00:00

    Hello @guidofranco
    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.

    Issue:

    • You deployed a Python web app using the Dash library on Azure App Service and tried to add authentication using Entra ID.
    • However, you encountered a 403 error when you tried to access the web app and were not being redirected to the Microsoft login page as expected.
    • You configured the issuer URL as https://login.microsoftonline.com/<tenant id>/v2.0 and entered the app id from an app registration created on a different Entra ID tenant in the Azure portal.
    • Solution:

    You resolved this issue by choosing the " HTTP 302 Found redirect" option for the "Unauthenticated request" requirement for your Python web app in the Azure portal

    Best, Grace

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Guido Nahuel Franco 40 Reputation points
    2024-01-05T20:31:47.8233333+00:00

    I solved it by choosing the first option: HTTP 302

    User's image

    0 comments No comments

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.