New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AzureFileCopy@4 does not work, but AzureFileCopy@3 does when copying files to blog storage #13159
Comments
@samsmithnz Are you giving the inputs as a yaml file or in the azure task itself ? |
Please let us know the version of AzureFileCopyV4 used if you face the error again |
Permissions should be all set, I use this same service connection for other deployments and AzureFileCopyV3 is working on the same connection? Saying that, I get a different error now, which does indicate permissions. Not sure that makes sense, given it's the same settings/storage/etc from v3 to v4, and the SPN has full permissions. I created another job, with the same settings and V3 and V4. Here are the logs, V3 is working, V4 is not. V3 log:2020-06-24T11:20:11.5065143Z ##[section]Starting: Copy ARM Templates to Azure Storage V3 V4 log:2020-06-24T11:20:27.1856426Z ##[section]Starting: Copy ARM Templates to Azure Storage V4 YAML:I tried it with both the classic UI and YAML, and get the same result. The only difference is that I appended an A and B to the blobprefix, so that each task would copy to a unique location
|
@samsmithnz This error [AuthorizationPermissionMismatch] comes up only if we do not provide storage blob owner and storage blob contributor permissions to the SPN. Can you please check if these permissions are given to SPN? |
I've confirmed that the SPN has contributor access to the subscription. Does V3 use the SPN in a different way? Why do I get errors with the new version and not the old version? |
@samsmithnz Yes it is different. AzureFileCopyV3 uses azcopy.exe version 7, and AzureFileCopyV4 uses azcopy.exe version 10. |
Looks like I already have contributor and owner access to the storage, (inherited from the subscription), which I wouldn't normally think is enough. Adding the storage contributor role worked, but I have to admit, it's odd having to add an extra role. Any idea why they made this change? Otherwise this issue can be closed. |
@samsmithnz This permission thing came as a document with new Azcopy.exe version. I can't say why this change has been made. But you have to give these required permissions to run AzureFileCopyV4 task. I hope all your queries are solved now. |
Closing this one, feel free to reopen if face any issue. |
Thank you @20shivangi. One last thought: Should any of this be in the v4 task docs? I don't see anything, but it's a change. |
@samsmithnz I will check this, if it is not documented, I will take care of it |
Seems weird that (A) AzCopy v10 (and hence AzureFileCopy@4) enforces permissions differently than the underlying blob storage data plane, and (B) that granting permissions via the "this pipeline needs permissions to run" popup when running the Azure Pipeline grants sufficient permissions for AzureFileCopy@3 task but not the AzureFileCopy@4 task. For those unfortunate enough to be as confused about this as I was, the solution is to:
|
Question, Bug, or Feature?
Type: Bug
Enter Task Name: AzureFileCopy@4
Environment
Server - Azure Pipelines
Agent - Hosted: Windows 2017
Issue Description
This is my yaml definition:
Task logs
Uploading files from source path: 'd:\a\1\s\ArmTemplateTestProject\ArmTemplateTestProject\azuredeploy.json' to storage account: 'mydatastorage' in container: 'armtemplate' with blob prefix: ''
& "AzCopy\AzCopy.exe" copy "d:\a\1\s\ArmTemplateTestProject\ArmTemplateTestProject\azuredeploy.json" "https://mydatastorage.blob.core.windows.net/armtemplate"
Error: wrong number of arguments, please refer to the help page on usage of this command
Troubleshooting
Version 3 of the task, with the same settings appears to work. I can't see anything wrong with the arguments, it appears from the logs to be using the same azcopy command
The text was updated successfully, but these errors were encountered: