SyntaxC4-MSFT / ComposerExtension

Brings Composer Support to Azure Websites via a Site Extension
http://www.siteextensions.net
MIT License
15 stars 7 forks source link
azure composer php

Azure App Service Web App Composer Site Extension

This site extension adds Composer support to Web App to enable dependency management for PHP applications.

Installation

Follow the instructions outlined in the article How to enable a Site Extension in Azure App Service Web App when selecting an extension look for the list item for Composer.

Usage

There are multiple ways to use Composer from Web App.

Continuous Deployment

This sample application demonstrates the usage of the composer.json file in Web App.

Command-Line

Timeout configuration

In some cases (especially when attempting to install great amount of packages, #1) the deployment may timeout and the dependencies won't get loaded correctly by Composer. A simple fix is to add a deployment configuration (create .deployment file) with parameter SCM_COMMAND_IDLE_TIMEOUT and set it to bigger number (for example SCM_COMMAND_IDLE_TIMEOUT=600 where 600 is time out in seconds). The default value in Azure Web Apps for this setting appears to be 400 seconds.

AppSettings

Name Value Notes
APPSETTING_COMMAND %XDT_EXTENSIONPATH%\Hooks\deploy.cmd Deployment Hook Command.
PATH %PATH%;%XDT_EXTENSIONPATH%\Commands;%APPDATA%\Composer\vendor\bin Overwrites the Path. Last Extension Wins
COMPOSER_ARGS --prefer-dist --no-dev --optimize-autoloader --no-progress Command line arguments for composer during deploy.cmd execution