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

[BUG]: AzCopy login/logout deprecation #19076

Closed
1 of 4 tasks
thkn-hofa opened this issue Oct 6, 2023 · 6 comments
Closed
1 of 4 tasks

[BUG]: AzCopy login/logout deprecation #19076

thkn-hofa opened this issue Oct 6, 2023 · 6 comments

Comments

@thkn-hofa
Copy link

thkn-hofa commented Oct 6, 2023

Task name

AzureFileCopy

Task version

5.* (probably all of the versions)

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows 2022

Task log

& "AzCopy\AzCopy.exe" login --service-principal --application-id "***" --tenant-id="redacted" --aad-endpoint "[https://login.windows.net/"](https://login.windows.net/%22)
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.
INFO: SPN Auth via secret succeeded.
INFO: AzCopy.exe: A newer version 10.21.0 is available to download

INFO: AzCopy.exe: A newer version 10.21.0 is available to download

Uploading files from source path: 'C:\buildagents\agentdir\_work\3\*.zip' to storage account: 'redacted' in container: 'redacted' with blob prefix: 'redacted'
 & "AzCopy\AzCopy.exe" copy "C:\buildagents\agentdir\_work\3\*.zip" "[https://redacted.blob.core.windows.net/redacted/redacted"](https://redacted.blob.core.windows.net/redacted/redacted%22)  --log-level=DEBUG
INFO: Scanning...

failed to perform copy command due to error: Login Credentials missing. No SAS token or OAuth token is present and the resource is not public
 & "AzCopy\AzCopy.exe" logout
Error: failed to perform logout command, no cached token found for current user
Usage:
  azcopy logout [flags]

Flags:
  -h, --help   help for logout

Flags Applying to All Commands:
      --cap-mbps float                      Caps the transfer rate, in megabits per second. Moment-by-moment throughput might vary slightly from the cap. If this option is set to zero, or it is omitted, the throughput isn't capped.
      --output-type string                  Format of the command's output. The choices include: text, json. The default value is 'text'. (default "text")
      --trusted-microsoft-suffixes string   Specifies additional domain suffixes where Azure Active Directory login tokens may be sent.  The default is '*.core.windows.net;*.core.chinacloudapi.cn;*.core.cloudapi.de;*.core.usgovcloudapi.net;*.storage.azure.net'. Any listed here are added to the default. For security, you should only put Microsoft Azure domains here. Separate multiple entries with semi-colons.


failed to perform logout command, no cached token found for current user
Disconnect-AzAccount -Scope Process -ErrorAction Stop
Clear-AzContext -Scope Process -ErrorAction Stop
##[error]Upload to container: 'redacted' in storage account: 'redacted' with blob prefix: 'redacted' 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
Finishing: AzureBlob Zip File Copy

Relevant log output

Uploading files from source path: 'C:\buildagents\agentdir\_work\3\*.zip' to storage account: 'redacted' in container: 'redacted' with blob prefix: 'redacted'
 & "AzCopy\AzCopy.exe" copy "C:\buildagents\agentdir\_work\3\*.zip" "[https://redacted.blob.core.windows.net/redacted/redacted"](https://redacted.blob.core.windows.net/redacted/redacted%22)  --log-level=DEBUG
INFO: Scanning...

failed to perform copy command due to error: Login Credentials missing. No SAS token or OAuth token is present and the resource is not public

Aditional info

I upgraded azcopy from 10.8.0 to 10.21.0 on my self-hosted build server and ran into the described errors. I logged an issue on the AzCopy GitHub project but they informed me that the login/logout mechanism is being deprecated and instead it now relies on environment variables.

Source: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-authorize-azure-active-directory#authorize-a-service-principal-by-using-a-client-secret

@v-mohithgc
Copy link
Contributor

Hi @thkn-hofa thanks for reporting! We are working on more prioritized issues at the moment, but will get back to this one soon.

@v-mohithgc v-mohithgc added the Area:RM RM task team label Oct 9, 2023
@thkn-hofa
Copy link
Author

Thanks @v-mohithgc for the feedback. No worries, I reverted to a previous version of azcopy for the time being.

Copy link

github-actions bot commented Apr 6, 2024

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

@github-actions github-actions bot added the stale label Apr 6, 2024
@thkn-hofa
Copy link
Author

Still no fix, I presume?

@v-mohithgc
Copy link
Contributor

Hi @thkn-hofa, the new version of azure file copy task that is version 6 will address this issue, please use V6.

@github-actions github-actions bot removed the stale label Apr 8, 2024
@FlsZen
Copy link

FlsZen commented Apr 19, 2024

I can confirm that updating to @6 fixed this error in my pipeline.

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

No branches or pull requests

3 participants