<p>kubectl task failing to deploying manifest files into AKS. pipeline failing with below error</p>
<p><strong>##[error]No configuration file matching /home/vsts/work/1/s/manifests was found.</strong></p>
<p>pipeline is working fine with run both stages (Like Build and Deploy) because after build stage it will create the artifacts for that manifest files and it will download in deploy stage and deploy in to AKS..</p>
<p>I have issue occur if I select stages to run only for deploy stage it will fail with above error msg..</p>
<p>Pipeline</p>
<pre><code>- master

resources:
- repo: self

variables:
  tag: '$(Build.BuildId)'
  imagePullSecret: 'aks-acr-auth'

stages:
- stage: Build
  displayName: Build image
  jobs:
  - job: Build
    displayName: Build
    pool:
      vmImage: ubuntu-latest
    
    steps:
    - task: Docker@2
      displayName: Build And Push Into ACR
      inputs:
        containerRegistry: 'AKS-ACR'
        repository: 'apps/web'
        command: 'buildAndPush'
        Dockerfile: '$(Build.SourcesDirectory)/app/Dockerfile'
        tags: |
          $(tag)

    - publish: manifests
      artifact: manifests
        
- stage: 'Deployment'
  displayName: 'Deploy To AKS'
  jobs:
    - deployment: Release
      environment: 'DEV-AKS.default'
      displayName: 'Release'
      pool:
        vmImage: ubuntu-latest
      strategy:
        runOnce:
          deploy:
            steps:

            - task: KubernetesManifest@0
              displayName: Create imagePullSecret
              inputs:
                action: 'createSecret'
                kubernetesServiceConnection: 'DEV-AKS'
                secretType: 'dockerRegistry'
                secretName: '$(imagePullSecret)'
                dockerRegistryEndpoint: 'AKS-ACR'

            - task: DownloadPipelineArtifact@2
              inputs:
                buildType: 'current'
                artifactName: 'manifests'
                targetPath: '$(Pipeline.Workspace)'

            - task: Kubernetes@1
              displayName: Deploying Manifests into AKS
              inputs:
                connectionType: 'Kubernetes Service Connection'
                kubernetesServiceEndpoint: 'DEV-AKS'
                namespace: 'default'
                command: 'apply'
                useConfigurationFile: true
                configuration: 'manifests'
                secretType: 'dockerRegistry'
                containerRegistryType: 'Azure Container Registry'
</code></pre>

Avi
<p>As per Kasun comment I added -checkout: self and $(Build.SourcesDirectory) in pipeline it's works..</p>
<p>Pipeline</p>
<pre><code>
- master

resources:
- repo: self

variables:
  imagePullSecret: 'acr-auth'

stages:
        
- stage: 'Deployment'
  displayName: 'Deploy To AKS'
  jobs:
    - deployment: Release
      environment: 'DEV-AKS.default'
      displayName: 'Release'
      pool:
        vmImage: ubuntu-latest
      strategy:
        runOnce:
          deploy:
            steps:
            - checkout: self

            - task: KubernetesManifest@0
              displayName: Create imagePullSecret
              inputs:
                action: 'createSecret'
                kubernetesServiceConnection: 'DEV-AKS'
                secretType: 'dockerRegistry'
                secretName: '$(imagePullSecret)'
                dockerRegistryEndpoint: 'AKS-ACR'

            - script: dir $(Build.SourcesDirectory)/manifests
              displayName: Cloning Manifest Files From Repo
              
            - task: KubernetesManifest@0
              displayName: Deploying Manifests InTo AKS
              inputs:
                action: 'deploy'
                kubernetesServiceConnection: 'DEV-AKS'
                namespace: 'default'
                manifests: |
                  manifests/deployment.yml
                  manifests/service.yml
                imagePullSecrets: '$(imagePullSecret)'
</code></pre>
