You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何使用Azure CopyFiles@2仅复制源根目录下的JSON文件?

仅复制根目录JSON文件的CopyFiles@2配置

你当前用的**/*.json是递归通配模式,会匹配$(build.sourcesdirectory)及其所有子目录下的JSON文件。要只复制该根目录下的JSON文件,把Contents改为*.json即可——因为SourceFolder已经指定了根目录路径,*.json会直接匹配该目录下的所有JSON文件,不会递归子目录。

修改后的完整任务配置:

- task: CopyFiles@2
  displayName: "Copy Files to: $(DropLocation)"
  condition: always()
  inputs:
      SourceFolder: $(build.sourcesdirectory)
      Contents: "*.json"
      TargetFolder: "$(DropLocation)"
      flattenFolders: true

内容的提问来源于stack exchange,提问作者Naveen Kumar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 20:29:51