0

so I'm new to azure deployment and I try my best to use the microsoft documentation tutorial https://learn.microsoft.com/en-us/azure/app-service/tutorial-php-mysql-app?pivots=platform-windows

everything is fine until "Deploy to Azure" Step in :

git push azure main

remote:   [ErrorException]
remote:   Trying to access array offset on value of type null
remote: An error has occurred during web site deployment.
remote:
remote: composer failed
remote:
remote:
remote: Error - Changes committed to remote repository but deployment to website failed.
To https://phpmysqldemogs.scm.azurewebsites.net/phpMysqlDemoGS.git

The log detail from Deployment Center > Logs show I have failed commit with detail log

Command: bash deploy.sh
 Creating app_offline.htm
 KuduSync.NET from: 'C:\home\site\repository' to: 'C:\home\site\wwwroot'
 Deleting app_offline.htm
 Running composer install
    
                                                           
   [ErrorException]                                     
   Trying to access array offset on value of type null  
                                                           
 An error has occurred during web site deployment.
    
 composer failed
 [ErrorException]                                     \r\n  Trying to access array offset on value of type null\r\nC:\Program Files (x86)\SiteExtensions\Kudu\95.30831.5373\bin\Scripts\starter.cmd bash deploy.sh

I tried to push again, it says "already up to date"

I tried to clone repo from azure, do composer install then php artisan serve ... it worked locally, so I assume that the problem is in deployment configuration. Can anyone help the production problem?

Thanks in advance.

torek
  • 448,244
  • 59
  • 642
  • 775
Gradiyanto Sanjaya
  • 115
  • 1
  • 2
  • 7
  • Note that any message that starts with `remote:` is not coming *from Git*. Instead, Git is just the messenger. Don't shoot (or even bother tagging) the messenger. :-) – torek Nov 12 '21 at 13:37

1 Answers1

0

This error Error - Changes committed to remote repository but deployment to website failed. occurs when you push a local branch that doesn't match the app deployment branch on 'azure'.

  • To resolve this error, Verify that the current branch is master. To change the default branch, use DEPLOYMENT_BRANCH application setting (refer to Change deployment branch).

You are also getting Trying to access array offset on value of type null error and that is failing composer.

  • To resolve this error, you need to updater the composer.
composer update

OR

php composer.phar update

enter image description here

You can refer to Troubleshoot deployment and Error "Trying to access array offset on value of type null"

Ecstasy
  • 1,866
  • 1
  • 9
  • 17