Azure App - Web PHP - newly deployed 404 error

Aaron Bailey 6 Reputation points
2022-04-05T22:25:40.647+00:00

I recently deployed a web app to test out Azure as a hosting platform.

The configuration is php 8 with local git. I was able to connect through git and deploy a website. When I try to navigate to the site I get a 404 error. I did some digging and if I use: myapp.azurewebsites.net/.auth/login/aad/callback it will redirect a couple times and take me to a landing page and then from there on I can navigate to my website... at least until the session ends and then I'm back to 404 errors.

This is a free azure deployment there is no special configuration or setup... I'm really just testing out azure as a hosting platform and wondering how to solve this issue.

The site is also configured such that only members of the tenant can access the site, which is by design, and I can authenticate and access the site but only after using myapp.azurewebsites.net/.auth/login/aad/callback

I would have expected.. so long as I have logged in and have an open session / cookie then I can freely navigate the page without first needing to use the callback

Suggestions?

Thanks,

Aaron

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,155 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
20,095 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Takahito Iwasa 4,841 Reputation points MVP
    2022-04-05T22:47:14.777+00:00

    Hi, @Aaron Bailey

    Did you configure Azure AD authentication?
    Please check the following link.

    https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad

    Are you following the steps in Option 1?
    If so, try option 2 as well. And let's compare the settings of the applications registered in the Azure AD tenant.

    0 comments No comments

  2. Aaron Bailey 6 Reputation points
    2022-04-06T02:26:52.01+00:00

    Hello thank you for the response.

    Yes I saw this article previously and when I go through step 1 there is already a Microsoft Identity provider added... this came automatically when I added the Azure App.

    I can add others but I'm not integrating with any other platforms at this time... and I cannot add Microsoft a second time.

    Digging around in the app configuration I did find under authentication "Redirect URIs" and the https://myapp.azurewebsites.net/.auth/login/aad/callback URI is listed there

    I added https://myapp.azurewebsites.net/ and restarted the app but this hasn't resolved the issue.

    All the steps in option 2 on that page were already done for me when I created the app. I went through the steps though and verified them.