deployed a PHP app in the Azure web app service having issue

2021-05-20T04:20:15.73+00:00

Hi All,
I have deployed a PHP app in the Azure web app service. The app is on git repo which I have configured in Deployment Center. But when I open the link URL for my app https://xyz-poc-dev.azurewebsites.net/ it still shows the below message:

Hey, App Service developers!

Your app service is up and running.
Time to take the next step and deploy your code.

Note: I even tried deploying my App on the LAMP stack on a VM it's working so please let me know what's missing.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
0 comments No comments
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2021-05-21T13:35:58.57+00:00

    Thanks for asking question! Could you please confirm if you have you pushed to Azure from Git?

    1. From your local terminal window, add an Azure remote to your local Git repository by using below command: git remote add azure <deploymentLocalGitUrl-from-create-step> Replace <deploymentLocalGitUrl-from-create-step> with the URL of the Git remote.
    2. Then push to the Azure remote to deploy your app with the following command: git push azure master
    3. When Git Credential Manager prompts you for credentials, make sure you enter the credentials you created in Configure a deployment user, not the credentials you use to sign in to the Azure portal.

    Check this document link: https://learn.microsoft.com/en-gb/azure/app-service/deploy-local-git?toc=%2Fazure%2Fapp-service%2Ftoc.json&tabs=portal#deploy-the-web-app

    Further you could review the Startup script and configuration for the PHP frame as mentioned in below documents.
    Configure a Windows PHP app for Azure App Service
    Configure a Linux PHP app for Azure App Service

    Please note that by default, Azure App Service points the root virtual application path (/) to the root directory of the deployed application files (sites\wwwroot).
    On Linux, the container runs Apache, you can rewrite the URL to public/index.php with a single .htaccess file in our root directory.

    Also, ensure that the Rewrite rules are appropriate to map URLs to public/index.php file.

    The default PHP image for App Service uses Apache, and it doesn't let you customize the site root for your app. To work around this limitation, add an .htaccess file to your repository root.

    Additionally Azure provides built-in diagnostics to assist with debugging an App Service app.
    Check this article, you learn how to enable diagnostic logging and add instrumentation to your application, as well as how to access the information logged by Azure.

    Let us know if there is further query or issue remains.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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