The current deployment branch is ''main'', but nothing has been pushed to it

768 views Asked by At

When following the Azure App Service PHP quick start guide you receive the below error;

remote: The current deployment branch is ''main'', but nothing has been pushed to it
remote: Error - Changes committed to remote repository but deployment to website failed.
remote: Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
remote:    at Kudu.Console.Program.PerformDeploy(String appRoot, String wapTargets, String deployer, String lockPath, IEnvironment env, IDeploymentSettingsManager settingsManager, TraceLevel level, ITracer tracer, ITraceFactory traceFactory, IOperationLock deploymentLock)
remote:    at Kudu.Console.Program.Main(String[] args)
remote: Aborted (core dumped)
1

There are 1 answers

0
vdidxho On BEST ANSWER

The target deployment branch was set to 'main' instead of main despite following the instructions.

Change

  • az webapp config appsettings set --name <app-name> --resource-group myResourceGroup --settings DEPLOYMENT_BRANCH='main'

To

  • az webapp config appsettings set --name <app-name> --resource-group myResourceGroup --settings DEPLOYMENT_BRANCH=main

Note: I was using azure cli via cmd.exe except for the line setting php version as the Pipe character caused issues. It would be interesting know if using Cloud Cli would have avoided the issue entirely.