How to Deploy my php application on Windows Webapp

Jason Zwanepoel 66 Reputation points
2020-06-02T20:34:46.037+00:00

Hi all hope you can assist

I have an Azure pipeline to build and zip my code and then add push artifact

When I do this I noticed that my Code files gets added to a folder called 's'

Below you will find what I have attempted to set up and attatched you will see my Deployment

Please Assist me I need to make the code go under my wwwroot folder and not wwwroot\s

My azure-pipelines.yml

trigger:

  • master

pool:
vmImage: 'ubuntu-latest'

variables:
phpVersion: 7.2

steps:

  • script: |
    sudo update-alternatives --set php /usr/bin/php$(phpVersion)
    sudo update-alternatives --set phar /usr/bin/phar$(phpVersion)
    sudo update-alternatives --set phpdbg /usr/bin/phpdbg$(phpVersion)
    sudo update-alternatives --set php-cgi /usr/bin/php-cgi$(phpVersion)
    sudo update-alternatives --set phar.phar /usr/bin/phar.phar$(phpVersion)
    php -version
    displayName: 'Use PHP version $(phpVersion)'
  • script: composer install --no-interaction --prefer-dist
    displayName: 'composer install'
  • task: ArchiveFiles@2
    inputs:
    rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
    includeRootFolder: true
    archiveType: 'zip'
    archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'
    replaceExistingArchive: true
  • task: PublishBuildArtifacts@1
    inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'drop'
    publishLocation: 'Container'

Kind Regards

9021-screencapture-dev-azure-jzwanepoel-ctu-dev-ctudeve.png
8870-azure-pipeline.png
8955-screencapture-dev-azure-jzwanepoel-ctu-dev-ctudeve.png

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,865 questions
0 comments No comments
{count} votes

Accepted answer
  1. Mark Allan 416 Reputation points MVP
    2020-06-02T21:14:40.307+00:00

    In the ArchiveFiles task, change includeRootFolder: true to includeRootFolder: false so it adds the files in the s folder to the ZIP but not the folder itself.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful