title: Azure DevOps - Build and Deploy simple PHP Web App
body: <p>I am trying to build and deploy a simple php app with index.php file using CI/CD and following <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/ecosystems/php-webapp?view=azure-devops" rel="nofollow noreferrer">this</a> link. Below is the yaml file that has been configured and the build pipeline is executed successfully.</p>
  <pre><code># PHP
  # Test and package your PHP project.
  # Add steps that run tests, save build artifacts, deploy, and more:
  # https://docs.microsoft.com/azure/devops/pipelines/languages/php
   
  trigger:
  - main
   
  variables:
   
    # Azure Resource Manager connection created during pipeline creation
    azureSubscription: 'phptestapp-connection'
    
    # Web app name
    webAppName: 'phptestapp'
    
    # Resource group
    resourceGroupName: 'MyResourceGroup'
   
    # Environment name
    environmentName: 'phptestapp'
   
    # Agent VM image name
    vmImageName: 'ubuntu-latest'
    
  stages:
  - stage: Archive
    displayName: Archive stage
    jobs:  
    - job: Archive
      displayName: Archive
      pool:
        vmImage: $(vmImageName)
      steps:   
      - task: AzureAppServiceSettings@1
        inputs:
          azureSubscription: $(azureSubscription)
          appName: $(webAppName)
          resourceGroupName: $(resourceGroupName)
          appSettings: |
            [
              {
                &quot;name&quot;: &quot;SCM_DO_BUILD_DURING_DEPLOYMENT&quot;,
                &quot;value&quot;: &quot;true&quot;
              }
            ]
      - task: ArchiveFiles@2
        displayName: 'Archive files'
        inputs:
          rootFolderOrFile: '$(System.DefaultWorkingDirectory)'
          includeRootFolder: false
          archiveType: zip
          archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
          replaceExistingArchive: true
   
      - upload: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
        artifact: drop
   
  - stage: Deploy
    displayName: Deploy stage
    dependsOn: Archive
    condition: succeeded()
    jobs:
    - deployment: Deploy
      displayName: Deploy
      environment: $(environmentName)
      pool: 
        vmImage: $(vmImageName)
      strategy:
        runOnce:
          deploy:
            steps:            
            - task: AzureWebApp@1
              displayName: 'Azure Web App Deploy: PHP Web App'
              inputs:
                azureSubscription: $(azureSubscription)
                appType: webAppLinux
                appName: $(webAppName)
                runtimeStack: 'PHP|7.2'
                package: $(Pipeline.Workspace)/drop/$(Build.BuildId).zip
  </code></pre>
  <p>However, when I configure and run release pipeline, it throws exception as below</p>
  <pre><code>&gt; Error: No package found with specified pattern:
  &gt; D:\a\r1\a\**\*.zip&lt;br/&gt; Check if the package mentioned in the task is
  &gt; published as an artifact in the build or a previous stage and
  &gt; downloaded in the current job.
  </code></pre>
  <p>P.S. Adding below in build pipeline yaml file is not making any impact</p>
  <pre><code>- task: PublishBuildArtifacts@1
  </code></pre>
  <p>The idea is to develop a CI/CD for a simple PHP web app and later implement the same concept to PHP framework like Wordpress/Laravel/Magento2</p>
  <p>Open to ideas and suggestions</p>