Azure DevOps发布Zip包未含隐藏目录,是否存在排除隐藏文件夹选项?
Great question! Let’s clear this up for you—Azure DevOps’ built-in Archive Files task does have a configuration option related to hidden files/folders, and the behavior you’re seeing is actually the default setting at work.
Here’s what you need to know:
- The task automatically excludes hidden files and folders by default via a setting called
excludeHiddenFiles, which is set totrueout of the box. That’s exactly why your/wwwroot/.well-knowndirectory isn’t showing up in the zip. - Yes, there absolutely is a configurable option to control this (and in your case, you’ll want to disable the exclusion to include the hidden directory).
How to adjust the setting:
1. Using the Visual Pipeline Editor
- Locate your Archive Files task in the pipeline editor.
- Expand the Advanced section (click the "Show advanced settings" link if it’s collapsed).
- Look for the checkbox labeled Exclude hidden files—uncheck this box to allow hidden directories/files to be included in the zip.
2. Using YAML
If you’re defining your pipeline with YAML, add the excludeHiddenFiles: false parameter to your ArchiveFiles@2 task. Here’s a quick example:
- task: ArchiveFiles@2 inputs: rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/wwwroot' includeRootFolder: false archiveType: 'zip' archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip' replaceExistingArchive: true excludeHiddenFiles: false # This disables the default exclusion of hidden content
Once you make this change, re-run your pipeline, and the .well-known directory should be included in your zip package as expected. If there are nested hidden files inside that directory, they’ll also be included with this setting.
内容的提问来源于stack exchange,提问作者Dreeco
相关产品推荐
相关产品推荐

