- task: PublishBuildArtifacts@1 inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)/DockerImage.tar' ArtifactName: 'Docker-Image' publishLocation: 'Container'
This is my Yaml Pipeline Script
This is the Error Logs
Fail to upload ‘/home/vsts/work/1/a/DockerImage.tar’ due to ‘Access to the path ‘/home/vsts/work/1/a/DockerImage.tar’ is denied.’.
System.UnauthorizedAccessException: Access to the path ‘/home/vsts/work/1/a/DockerImage.tar’ is denied.
—> System.IO.IOException: Permission denied
— End of inner exception stack trace —
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func2 errorRewriter) at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func
2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize)
at Microsoft.VisualStudio.Services.Agent.Worker.Build.FileContainerServer.UploadAsync(IAsyncCommandContext context, Int32 uploaderId, CancellationToken token) in /mnt/vss/_work/1/s/src/Agent.Worker/Build/FileContainerServer.cs:line 251
I tried Looking for how to give permission to my pipeline i was also using the
Pipeline.workspace location to publish my artifacts but there also i got the same error.
I am not sure how to give permission to my pipeline.
I am relatively new to Azure Devops platform.
Sanskar Arya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.