I'm trying install composer on azure portal from extension and it throw:
Failed to install Composer - ExitCode: -1073741819, Output: D:\home\SiteExtensions\ComposerExtension># Install Composer D:\home\SiteExtensions\ComposerExtension>cd Commands D:\home\SiteExtensions\ComposerExtension\Commands>IF EXIST composer.phar (rm -f composer.phar ) D:\home\SiteExtensions\ComposerExtension\Commands>IF NOT EXIST "D:\local\AppData\Composer" (mkdir "D:\local\AppData\Composer" ) D:\home\SiteExtensions\ComposerExtension\Commands>IF NOT EXIST "D:\local\LocalAppData\Composer" (mkdir "D:\local\LocalAppData\Composer" ) D:\home\SiteExtensions\ComposerExtension\Commands>php -r "readfile('https://getcomposer.org/installer');" | php, Error: '#' is not recognized as an internal or external command, operable program or batch file., Kudu.Core.Infrastructure.CommandLineException: '#' is not recognized as an internal or external command, operable program or batch file. D:\home\SiteExtensions\ComposerExtension\install.cmd at Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer tracer, Func
2 onWriteOutput, Func
2 onWriteError, Encoding encoding, String arguments, Object[] args) at Kudu.Core.Infrastructure.Executable.ExecuteWithProgressWriter(ILogger logger, ITracer tracer, String arguments, Object[] args) at Kudu.Core.SiteExtensions.SiteExtensionManager.<>c__DisplayClass25_1.b__1() at Kudu.Core.Infrastructure.OperationManager.<>c__DisplayClass2_0.b__0() at Kudu.Core.Infrastructure.OperationManager.Attempt[T](Func1 action, Int32 retries, Int32 delayBeforeRetry, Func
2 shouldRetry) at Kudu.Core.Infrastructure.OperationManager.Attempt(Action action, Int32 retries, Int32 delayBeforeRetry) at Kudu.Core.SiteExtensions.SiteExtensionManager.d__25.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Kudu.Core.SiteExtensions.SiteExtensionManager.d__24.MoveNext()
Thank for your help.
In my test, it seems due to the build in PHP runtime version. I will reproduce your issue if I set the PHP version to 7.1 in Azure portal. But the composer extension will be installed fine if I downgrade the build in PHP version to 7.0.
So currently, you can downgrade the PHP runtime to 7.0 as a workaround. Or try to manually download composer.phar extension in your project.