question

JasonZwanepoel-5675 avatar image
JasonZwanepoel-5675 asked ·

How to Deploy my php application on Windows Webapp

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-webappsazure-webapps-development
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

markxa avatar image
markxa answered ·

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 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @markxa
Thanks for commenting. Just before you answered my question I noticed this is the issue and all working now as expected
Thank you for the quick reply

1 Vote 1 · ·

Hi @markxa

Thank you once again or your assistance hope you can help with my next issue

When deploying to Azure Webapp Windows through Azure Devops.

So the issue is this. I know making the Physical Path to 'site\wwwroot' and virtual path of '/' will deploy my code to my wwwroot folder however I need the path to go to 'wwwroot\public' so that my application will work. This is a Laravel Application

How can I set this so that when I do a Deployment it adds my code to wwwroot instead of wwwroot\public but still keep access to my application.

0 Votes 0 · ·