azure devops 中的 azcopy 任务使我无法枚举目录,但不确定为什么
azcopy task in azure devops gives me failed to enum directory but not sure why
大家好,我花了很多时间,但我无法弄清楚为什么 azcopy 在一个步骤中工作,但在一个阶段包装时却不能。我需要使用阶段工作,见下文。使用阶段时注释掉的代码不起作用。
错误
我收到错误解析源位置“d:a\s\etc...无法枚举目录
我注意到了
使用阶段日志时
AzCopy\AzCopy.exe" /Source:"D:\a\s\src\Dev\settings\AppSettings.json
仅使用步骤时
AzCopy\AzCopy.exe" /Source:"D:\a\s\src\Dev\settings
trigger:
- none
variables:
- group: AppVariables
- group: AppVariables2
- name: workingdirectory
value: '$(System.DefaultWorkingDirectory)/$(AppSettingsJson)'
resources:
repositories:
- repository: templates
type: git
name: Dev/Core
# stages:
# - stage: upload_Dev_File
# displayName: 'Upload File'
# jobs:
# - deployment: DevDeploy
# pool:
# vmImage: 'windows-latest'
# environment: $(DevEnvironment)
# strategy:
# runOnce:
# deploy:
# steps:
# - task: AzureFileCopy@3
# displayName: 'Deploy file to blob storage'
# inputs:
# SourcePath: $(workingdirectory)
# azureSubscription: '$(MyAzureSubscription)'
# Destination: AzureBlob
# storage: appStorage
# ContainerName: myApp
# BlobPrefix: Dev/Settings
pool:
vmImage: 'windows-latest'
steps:
- task: AzureFileCopy@3
displayName: 'Deploy file to blob storage'
inputs:
SourcePath: $(workingdirectory)
azureSubscription: '$(MyAzureSubscription)'
Destination: AzureBlob
storage: appStorage
ContainerName: myApp
BlobPrefix: Dev/Settings
我还尝试了版本 2 和 4,如果更容易的话,没有 luck.Happy 在 powershell 中执行。关于这里出了什么问题有什么建议吗?
非常感谢
I get Error parsing source location "d:a\s\etc.... Failed to
enumerate directory
对于这个问题,我认为代理无法在 s
文件夹中找到文件。这是因为当舞台是运行时,一个新的代理被用来运行它。
下面是我对这个问题的复现:
作为解决方法,我们需要在阶段中添加一个 checkout
步骤。
- stage: upload_Dev_File
displayName: 'Upload File'
jobs:
- deployment: DevDeploy
pool:
vmImage: 'windows-latest'
environment: $(DevEnvironment)
strategy:
runOnce:
deploy:
steps:
- checkout: RepoName
- task: AzureFileCopy@3
displayName: 'Deploy file to blob storage'
inputs:
SourcePath: '$(workingdirectory)'
azureSubscription: '$(MyAzureSubscription)'
Destination: 'AzureBlob'
storage: 'appStorage'
ContainerName: 'myApp'
BlobPrefix: 'Dev/Settings'
添加结帐步骤后,效果很好:
大家好,我花了很多时间,但我无法弄清楚为什么 azcopy 在一个步骤中工作,但在一个阶段包装时却不能。我需要使用阶段工作,见下文。使用阶段时注释掉的代码不起作用。
错误
我收到错误解析源位置“d:a\s\etc...无法枚举目录
我注意到了
使用阶段日志时
AzCopy\AzCopy.exe" /Source:"D:\a\s\src\Dev\settings\AppSettings.json
仅使用步骤时
AzCopy\AzCopy.exe" /Source:"D:\a\s\src\Dev\settings
trigger:
- none
variables:
- group: AppVariables
- group: AppVariables2
- name: workingdirectory
value: '$(System.DefaultWorkingDirectory)/$(AppSettingsJson)'
resources:
repositories:
- repository: templates
type: git
name: Dev/Core
# stages:
# - stage: upload_Dev_File
# displayName: 'Upload File'
# jobs:
# - deployment: DevDeploy
# pool:
# vmImage: 'windows-latest'
# environment: $(DevEnvironment)
# strategy:
# runOnce:
# deploy:
# steps:
# - task: AzureFileCopy@3
# displayName: 'Deploy file to blob storage'
# inputs:
# SourcePath: $(workingdirectory)
# azureSubscription: '$(MyAzureSubscription)'
# Destination: AzureBlob
# storage: appStorage
# ContainerName: myApp
# BlobPrefix: Dev/Settings
pool:
vmImage: 'windows-latest'
steps:
- task: AzureFileCopy@3
displayName: 'Deploy file to blob storage'
inputs:
SourcePath: $(workingdirectory)
azureSubscription: '$(MyAzureSubscription)'
Destination: AzureBlob
storage: appStorage
ContainerName: myApp
BlobPrefix: Dev/Settings
我还尝试了版本 2 和 4,如果更容易的话,没有 luck.Happy 在 powershell 中执行。关于这里出了什么问题有什么建议吗?
非常感谢
I get Error parsing source location "d:a\s\etc.... Failed to enumerate directory
对于这个问题,我认为代理无法在 s
文件夹中找到文件。这是因为当舞台是运行时,一个新的代理被用来运行它。
下面是我对这个问题的复现:
作为解决方法,我们需要在阶段中添加一个 checkout
步骤。
- stage: upload_Dev_File
displayName: 'Upload File'
jobs:
- deployment: DevDeploy
pool:
vmImage: 'windows-latest'
environment: $(DevEnvironment)
strategy:
runOnce:
deploy:
steps:
- checkout: RepoName
- task: AzureFileCopy@3
displayName: 'Deploy file to blob storage'
inputs:
SourcePath: '$(workingdirectory)'
azureSubscription: '$(MyAzureSubscription)'
Destination: 'AzureBlob'
storage: 'appStorage'
ContainerName: 'myApp'
BlobPrefix: 'Dev/Settings'
添加结帐步骤后,效果很好: