Azure App Service (Linux) CI/CD build does not remove files that were deleted from repository

Michael van Olden 6 Reputation points
2021-03-19T12:52:30.127+00:00

I'm using Azure App Service (Linux) App Service Build Service (CI/CD) to deploy a PHP application.

I removed the files (package.json, eraseme.php), but those files are not deleted from /wwwroot when the site is deployed to Azure.

The Azure App Service Build Service does the following:

Clones the repository to a local directory path "/repository".
Runs package.json and composer.json to install dependencies.
Copies "/repository" to "/wwwroot".
When I list the contents of the "/repository" directory, my deleted files are NOT THERE. This directory properly reflects the 'master' branch of my GIT repository.

However, when the files are moved to "/wwwroot", the package.json and eraseme.php files ARE STILL THERE.

Has anyone else run into this issue? If so, I would appreciate any guidance that you are willing to offer.

Logs from Azure CI/CD deployment:

4:45:08 PM - Updating submodules.
4:45:10 PM - Preparing deployment for commit id 'da0f786f06'.
4:45:10 PM - Repository path is /home/site/repository
4:45:10 PM - Running oryx build...  (See Oryx logs below)
4:47:23 PM - Running post deployment command(s)...
4:47:24 PM - Triggering recycle (preview mode disabled).
4:47:24 PM - Deployment successful.

Oryx Logs

Command: oryx build /home/site/repository -o /home/site/wwwroot --platform php --platform-version 7.3 -i /tmp/8d8ea4eb902b3c0 --log-file /tmp/build-debug.log
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues

Oryx Version: 0.2.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1

Build Operation ID: |G/7ihko0yFs=.b39d9a41_
Repository Commit : da0f786f0646fc957398a50da31f19aff35f6193

Detecting platforms...
Detected following platforms:
php: 7.3.26

Using intermediate directory '/tmp/8d8ea4eb902b3c0'.

Copying files to the intermediate directory...
Done in 52 sec(s).

Source directory : /tmp/8d8ea4eb902b3c0
Destination directory: /home/site/wwwroot

PHP executable: /tmp/oryx/platforms/php/7.3.26/bin/php
Composer archive: /opt/php-composer/1.9.3/composer.phar
Running 'composer install --ignore-platform-reqs --no-interaction'...

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
Package operations: 5 installs, 0 updates, 0 removals
- Installing ckdarby/silverpopphp (dev-master 3b8c5ed): Cloning 3b8c5ed525 from cache
- Installing robrichards/xmlseclibs (dev-master 0f54660): Cloning 0f5466070e from cache
- Installing robrichards/wse-php (2.0.3): Loading from cache
- Installing firebase/php-jwt (dev-master bac0422): Cloning bac0422822 from cache
- Installing salesforce-mc/fuel-sdk-php (dev-master 8018468): Cloning 8018468706 from cache
Generating autoload files
Preparing output...

Copying files to destination directory '/home/site/wwwroot'...
Done in 31 sec(s).

Removing existing manifest file
Creating a manifest file...
Manifest file created.

Done in 88 sec(s).
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,382 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 27,031 Reputation points Microsoft Employee
    2021-03-19T22:06:05.92+00:00

    Hi @Michael van Olden ,

    The Azure App Service Deploy task has a RemoveAdditionalFilesFlag setting. Set that to true to remove the files that's on the destination. That should remove package.json and eraseme.php.

    Regards,
    Ryan

    1 person found this answer helpful.