Azure / azure-storage-azcopy

The new Azure Storage data transfer utility - AzCopy v10
MIT License
605 stars 218 forks source link

list option + Azure files cannot work with MSI "azure files requires a SAS token for authentication" #2740

Open nohato opened 3 months ago

nohato commented 3 months ago

Which version of the AzCopy was used?

Note: The version is visible when running AzCopy without any argument

v10.25

Which platform are you using? (ex: Windows, Mac, Linux)

windows

What command did you run?

Note: Please remove the SAS to avoid exposing your credentials. If you cannot remember the exact command, please retrieve it from the beginning of the log file.

Azcopy.exe login --identity Azcopy.exe list https://strn0621.file.core.windows.net/file/filename

What problem was encountered?

I have found issue regarding to using MSI when the azcopy uses list option for azure files.

Azcopy.exe login --identity Azcopy.exe list https://storageaccountname.blob.core.windows.net/file/filename → OK. Blob is OK. Azcopy.exe list https://storageaccountname.file.core.windows.net/file/filename → NG. SAS is required even though OAUTH is available. Azcopy.exe copy https://storageaccountname.file.core.windows.net/file/filename → OK. Copy option works fine.

List option + azure files + MSI is not available.

image image

How can we reproduce the problem in the simplest way?

1.Make windows VM . 2.Make Storage account and make blob and azure files on it. 3.Set contributor RBAC for windows VM system managed ID. 4.Execute azcopy command Azcopy.exe login --identity Azcopy.exe list https://storageaccountname.blob.core.windows.net/file/filename Azcopy.exe list https://storageaccountname.file.core.windows.net/file/filename Azcopy.exe copy https://storageaccountname.file.core.windows.net/file/filename

Have you found a mitigation/solution?

I could not clarify solution but copy option is working fine. List option is not well.

https://github.com/Azure/azure-storage-azcopy/blob/0475829f98233f7176a62dbac50d36e3d90e83d0/cmd/list.go#L236

tanyasethi-msft commented 2 months ago

Hi @nohato, Thanks for reporting this. This is expected when using Azure Files, and we are adding support for AzCopy List with Files OAuth and will be present in upcoming releases.