Skip to content
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

azcopy ls is not showing blobs in container #120

Closed
mvrequa opened this issue Nov 13, 2018 · 4 comments
Closed

azcopy ls is not showing blobs in container #120

mvrequa opened this issue Nov 13, 2018 · 4 comments

Comments

@mvrequa
Copy link

mvrequa commented Nov 13, 2018

I see this on Linux and OSX.

[admin@ip-0A05000B ~]$ azcopy --version
azcopy version 10.0.4-Preview
[admin@ip-0A05000B ~]$ azcopy login
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code BLC4LFLT9 to authenticate.
Login succeeded.

[admin@ip-0A05000B ~]$ azcopy ls "https://requawestus2.blob.core.windows.net/cyclecloud"
List is using OAuth token for authentication.

cannot list blobs for download. Failed with error -> github.com/Azure/azure-storage-azcopy/vendor/github.com/Azure/azure-storage-blob-go/azblob.NewResponseError, /go/src/github.com/Azure/azure-storage-azcopy/vendor/github.com/Azure/azure-storage-blob-go/azblob/zz_generated_response_error.go:28
===== RESPONSE ERROR (ServiceCode=AuthorizationPermissionMismatch) =====
Description=This request is not authorized to perform this operation using this permission.
RequestId:62af0922-301e-0085-2004-7b7e29000000
Time:2018-11-13T03:54:05.3116844Z, Details: 
   Code: AuthorizationPermissionMismatch
   GET https://requawestus2.blob.core.windows.net/cyclecloud?comp=list&restype=container&timeout=901
   Authorization: REDACTED
   User-Agent: [AzCopy/10.0.4-Preview Azure-Storage/0.3 (go1.10.3; linux)]
   X-Ms-Client-Request-Id: [99b8342d-573d-47a7-6e15-34888aa24380]
   X-Ms-Version: [2018-03-28]
   --------------------------------------------------------------------------------
   RESPONSE Status: 403 This request is not authorized to perform this operation using this permission.
   Content-Length: [279]
   Content-Type: [application/xml]
   Date: [Tue, 13 Nov 2018 03:54:05 GMT]
   Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
   X-Ms-Error-Code: [AuthorizationPermissionMismatch]
   X-Ms-Request-Id: [62af0922-301e-0085-2004-7b7e29000000]
   X-Ms-Version: [2018-03-28]

This is a complete reproduction after install on OSX and linux. There are no other options on the ls command - such as saskey for auth.

@seguler
Copy link
Contributor

seguler commented Nov 15, 2018

Closing this as it was fixed per the e-mail conversation. This error happens when the user does not have access to the data plane. One needs to be part of the 'Storage Blob Data Contributor' role to have this access.

@seguler seguler closed this as completed Nov 15, 2018
@juve
Copy link

juve commented May 28, 2019

The "Storage Blob Data Contributor" role is required even if you already have "Owner" or "Contributor" roles.

@zjwab118
Copy link

2022-03-31T03:13:09.0749190Z ##[section]Starting: AzureBlob File Copy
2022-03-31T03:13:09.0902271Z ==============================================================================
2022-03-31T03:13:09.0902654Z Task : Azure file copy
2022-03-31T03:13:09.0902978Z Description : Copy files to Azure Blob Storage or virtual machines
2022-03-31T03:13:09.0903258Z Version : 4.200.0
2022-03-31T03:13:09.0903503Z Author : Microsoft Corporation
2022-03-31T03:13:09.0903854Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-file-copy
2022-03-31T03:13:09.0904300Z ==============================================================================
2022-03-31T03:13:13.8688338Z ##[command]Import-Module -Name C:\Modules\az_7.1.0\Az.Accounts\2.7.4\Az.Accounts.psd1 -Global
2022-03-31T03:13:15.9600687Z ##[warning]Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide
2022-03-31T03:13:26.4103428Z ##[command]Clear-AzContext -Scope CurrentUser -Force -ErrorAction SilentlyContinue
2022-03-31T03:13:27.9153227Z ##[command]Clear-AzContext -Scope Process
2022-03-31T03:13:28.5923186Z ##[command]Connect-AzAccount -ServicePrincipal -Tenant ab6f0e1c-73be-44c3-b7fa-2e8dde81aae7 -Credential System.Management.Automation.PSCredential -Environment AzureCloud @processScope
2022-03-31T03:13:31.6251268Z ##[command] Set-AzContext -SubscriptionId d8eb57c4-cd61-452f-b8ab-b39d5904d864 -TenantId ab6f0e1c-73be-44c3-b7fa-2e8dde81aae7
2022-03-31T03:13:33.7057790Z ##[command]Import-Module -Name C:\Modules\az_7.1.0\Az.Resources\5.2.0\Az.Resources.psd1 -Global
2022-03-31T03:13:36.6509223Z ##[command]Import-Module -Name C:\Modules\az_7.1.0\Az.Storage\4.1.1\Az.Storage.psd1 -Global
2022-03-31T03:13:38.8540196Z ##[command]Import-Module -Name C:\Modules\az_7.1.0\Az.Compute\4.22.0\Az.Compute.psd1 -Global
2022-03-31T03:13:41.0163457Z ##[command]Import-Module -Name C:\Modules\az_7.1.0\Az.Network\4.14.0\Az.Network.psd1 -Global
2022-03-31T03:13:56.2877321Z ##[command] & "AzCopy\AzCopy.exe" login --service-principal --application-id "***" --tenant-id="ab6f0e1c-73be-44c3-b7fa-2e8dde81aae7" --aad-endpoint "https://login.windows.net/"
2022-03-31T03:13:56.3296807Z INFO: If you set an environment variable by using the command line, that variable will be readable in your command line history. Consider clearing variables that contain credentials from your command line history. To keep variables from appearing in your history, you can use a script to prompt the user for their credentials, and to set the environment variable.
2022-03-31T03:13:56.5507090Z INFO: AzCopy.exe: A newer version 10.14.1 is available to download
2022-03-31T03:13:56.5511186Z
2022-03-31T03:13:56.6376899Z INFO: SPN Auth via secret succeeded.
2022-03-31T03:13:56.8352076Z INFO: AzCopy.exe: A newer version 10.14.1 is available to download
2022-03-31T03:13:56.8354153Z
2022-03-31T03:13:56.8448325Z Uploading files from source path: 'D:\a\r1\a_Test-CI\dist*' to storage account: 'sniff3' in container: 'test' with blob prefix: ''
2022-03-31T03:13:56.8541410Z ##[command] & "AzCopy\AzCopy.exe" copy "D:\a\r1\a_Test-CI\dist*" "https://sniff3.blob.core.windows.net/test" --log-level=INFO --recursive
2022-03-31T03:13:56.8880537Z INFO: Scanning...
2022-03-31T03:13:56.8881910Z INFO: Authenticating to destination using Azure AD
2022-03-31T03:13:57.1866119Z INFO: AzCopy.exe: A newer version 10.14.1 is available to download
2022-03-31T03:13:57.1866777Z
2022-03-31T03:13:57.2349947Z INFO: Any empty folders will not be processed, because source and/or destination doesn't have full folder support
2022-03-31T03:13:57.2457674Z
2022-03-31T03:13:57.2459152Z Job 991bf250-667d-074c-5d50-fbe40d2ab49d has started
2022-03-31T03:13:57.2462009Z Log file is located at: C:\Users\VssAdministrator.azcopy\991bf250-667d-074c-5d50-fbe40d2ab49d.log
2022-03-31T03:13:57.2462412Z
2022-03-31T03:13:57.2462510Z
2022-03-31T03:13:57.6657525Z 0.0 %, 0 Done, 0 Failed, 26 Pending, 0 Skipped, 26 Total,
2022-03-31T03:13:57.6669984Z INFO: Authentication failed, it is either not correct, or expired, or does not have the correct permission -> github.com/Azure/azure-storage-blob-go/azblob.newStorageError, /home/vsts/go/pkg/mod/github.com/!azure/azure-storage-blob-go@v0.10.1-0.20201022074806-8d8fc11be726/azblob/zc_storage_error.go:42
2022-03-31T03:13:57.6678869Z ===== RESPONSE ERROR (ServiceCode=AuthorizationPermissionMismatch) =====
2022-03-31T03:13:57.6685149Z Description=This request is not authorized to perform this operation using this permission.
2022-03-31T03:13:57.6691796Z RequestId:3f2570e8-101e-0050-1ead-441353000000
2022-03-31T03:13:57.6697338Z Time:2022-03-31T03:13:57.6542590Z, Details:
2022-03-31T03:13:57.6713424Z Code: AuthorizationPermissionMismatch
2022-03-31T03:13:57.6721675Z PUT https://sniff3.blob.core.windows.net/test/conversion_extraction/convert_blob_image_avif.py?timeout=901
2022-03-31T03:13:57.6729690Z Authorization: REDACTED
2022-03-31T03:13:57.6810982Z Content-Length: [6750]
2022-03-31T03:13:57.7227330Z User-Agent: [TFS_useragent AzCopy/10.8.0 Azure-Storage/0.10 (go1.13; Windows_NT)]
2022-03-31T03:13:57.7236903Z X-Ms-Blob-Cache-Control: []
2022-03-31T03:13:57.7240642Z X-Ms-Blob-Content-Disposition: []
2022-03-31T03:13:57.7247162Z X-Ms-Blob-Content-Encoding: []
2022-03-31T03:13:57.7254554Z X-Ms-Blob-Content-Language: []
2022-03-31T03:13:57.7263289Z X-Ms-Blob-Content-Md5: []
2022-03-31T03:13:57.7271050Z X-Ms-Blob-Content-Type: [text/plain]
2022-03-31T03:13:57.7278422Z X-Ms-Blob-Type: [BlockBlob]
2022-03-31T03:13:57.7288130Z X-Ms-Client-Request-Id: [4ac5e717-8418-4dcb-7bf7-cb11bba1edc9]
2022-03-31T03:13:57.7293140Z X-Ms-Version: [2019-12-12]
2022-03-31T03:13:57.7296466Z --------------------------------------------------------------------------------
2022-03-31T03:13:57.7303577Z RESPONSE Status: 403 This request is not authorized to perform this operation using this permission.
2022-03-31T03:13:57.7358532Z Content-Length: [279]
2022-03-31T03:13:57.7378581Z Content-Type: [application/xml]
2022-03-31T03:13:57.7386342Z Date: [Thu, 31 Mar 2022 03:13:57 GMT]
2022-03-31T03:13:57.7394025Z Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
2022-03-31T03:13:57.7511822Z X-Ms-Client-Request-Id: [4ac5e717-8418-4dcb-7bf7-cb11bba1edc9]
2022-03-31T03:13:57.7567335Z X-Ms-Error-Code: [AuthorizationPermissionMismatch]
2022-03-31T03:13:57.8261228Z X-Ms-Request-Id: [3f2570e8-101e-0050-1ead-441353000000]
2022-03-31T03:13:57.8284716Z X-Ms-Version: [2019-12-12]
2022-03-31T03:13:57.8294612Z
2022-03-31T03:13:57.8340528Z
2022-03-31T03:13:57.8354493Z
2022-03-31T03:13:59.2398996Z 0.0 %, 0 Done, 0 Failed, 26 Pending, 0 Skipped, 26 Total,
2022-03-31T03:13:59.2399876Z
2022-03-31T03:13:59.2400352Z
2022-03-31T03:13:59.2401321Z Job 991bf250-667d-074c-5d50-fbe40d2ab49d summary
2022-03-31T03:13:59.2405143Z Elapsed Time (Minutes): 0.0334
2022-03-31T03:13:59.2408689Z Number of File Transfers: 26
2022-03-31T03:13:59.2410592Z Number of Folder Property Transfers: 0
2022-03-31T03:13:59.2412204Z Total Number of Transfers: 26
2022-03-31T03:13:59.2422989Z Number of Transfers Completed: 0
2022-03-31T03:13:59.2423577Z Number of Transfers Failed: 1
2022-03-31T03:13:59.2424080Z Number of Transfers Skipped: 0
2022-03-31T03:13:59.2424658Z TotalBytesTransferred: 0
2022-03-31T03:13:59.2425116Z Final Job Status: Cancelled
2022-03-31T03:13:59.2425397Z
2022-03-31T03:13:59.3879656Z ##[command] & "AzCopy\AzCopy.exe" logout
2022-03-31T03:13:59.4210670Z INFO: Logout succeeded.
2022-03-31T03:13:59.6548145Z INFO: AzCopy.exe: A newer version 10.14.1 is available to download
2022-03-31T03:13:59.6560126Z
2022-03-31T03:13:59.6587494Z INFO: AzCopy.exe: A newer version 10.14.1 is available to download
2022-03-31T03:13:59.6589160Z
2022-03-31T03:13:59.7622121Z ##[warning]A parameter cannot be found that matches parameter name 'and'.
2022-03-31T03:13:59.8702810Z ##[error]Upload to container: 'test' in storage account: 'sniff3' with blob prefix: '' failed with error: 'AzCopy.exe exited with non-zero exit code while uploading files to blob storage.' For more info please refer to https://aka.ms/azurefilecopyreadme
2022-03-31T03:13:59.9161135Z ##[section]Finishing: AzureBlob File Copy

@zjwab118
Copy link

who can help me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants