'Azure Pipeline: File Transform task fails

I added a file transform task to the build pipeline. Here is a part of the pipeline:

        - task: FileTransform@1
        inputs:
          folderPath: '$(System.DefaultWorkingDirectory)/**/*.zip'
          fileType: 'json'
          targetFiles: 'local.settings.json'
          
      - task: DotNetCoreCLI@2
        displayName: 'DotNet Build Projects'
        inputs:
          command: 'build'
          projects: '**/*.csproj'
          arguments: --configuration $(buildConfiguration)          
         
      - task: DotNetCoreCLI@2
        displayName: 'Run Unit Tests'
        inputs:
          command: 'test'
          projects: '**/LATICRETE.IdentityFunctions.Tests/*.csproj'
          arguments: '--configuration $(buildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=$(Build.SourcesDirectory)/TestResults/Coverage/'
          publishTestResults: true          
          
      - script: |
              dotnet tool install -g dotnet-reportgenerator-globaltool
              reportgenerator -reports:$(Build.SourcesDirectory)/TestResults/Coverage/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage -reporttypes:HtmlInline_AzurePipelines;Cobertura
        displayName: Create Code Coverage Report          
          
      - task: PublishCodeCoverageResults@1
        displayName: 'Publish Code Coverage'
        inputs:
          codeCoverageTool: Cobertura
          summaryFileLocation: '$(Build.SourcesDirectory)/**/coverage.cobertura.xml'
          reportDirectory: '$(Build.SourcesDirectory)/TestResults/Coverage/'          
        
      - task: DotNetCoreCLI@2
        displayName: Publish Function App
        inputs:
          command: 'publish'
          publishWebProjects: false
          projects: '**/LATICRETE.IdentityFunctions/*.csproj'
          arguments: '--configuration $(buildConfiguration) --output $(build.artifactstagingdirectory)'
          zipAfterPublish: True
          
      - task: PublishBuildArtifacts@1
        displayName: 'Publish Function Artifact'
        inputs:
          PathtoPublish: '$(build.artifactstagingdirectory)'
          ArtifactName: 'function'

The build in Azure fails with the following error:

##[warning]Can't find loc string for key: Nopackagefoundwithspecifiedpattern ##[error]Error: Nopackagefoundwithspecifiedpattern D:\a\1\s***.zip

How can this be fixed?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source