-
Notifications
You must be signed in to change notification settings - Fork 231
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
Cannot use AZCOPY_OAUTH_TOKEN_INFO to auth in 10.21.0 version #2434
Comments
Thank you for reporting this! We are taking a look at this. |
Hi @RobinLin666 ! AZCOPY_OAUTH_TOKEN_INFO is for internal usage only, see the comment from the AzCopy codebase below. azure-storage-azcopy/common/environment.go Lines 309 to 312 in 7f3ebae
With this being said, was this working for you in previous versions? Additionally, we recommend all our customers follow this documentation (https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-authorize-azure-active-directory) in regard to authorizing with AzCopy. |
Hi @siminsavani-msft, This is how I use it in v10.18.1. import os
aad_token = mssparkutils.credential.getToken("storage")
import jwt, json
token = aad_token
token_json = jwt.decode(token, algorithms='RS256', options={"verify_signature": False})
print(token_json)
# token = token[1:]
token_info = {
"access_token": token,
"token_type": "Bearer",
"not_before": token_json.get("nbf", ""),
"expires_on": token_json.get("exp", ""),
"expires_in": str(
int(float(token_json.get("exp", "0")) - float(token_json.get("nbf", "0")))),
"resource": "https://storage.azure.com",
"_token_refresh_source": "tokenstore"
}
os.environ.setdefault("AZCOPY_OAUTH_TOKEN_INFO", json.dumps(token_info))
# run bash shell
!azcopy list https://xxx.blob.core.windows.net/xxx |
@RobinLin666 AAD has been renamed to Entra ID. The documentation contains the latest way to authorize with AzCopy. I would recommend checking out the managed identity or service principal sections of the doc. I'll continue investigating the |
Thank you very much, I will check the doc. |
Just an update, I was able to repro your issue and have marked this as a bug. We will continue working on this issue and update the thread with a fix in the next few upcoming releases. |
The 10.22.0 version was just released and the above PR was included in the release. Closing this issue as a result. Please feel free to open a new issue if you are experiencing any issues with latest AzCopy and we are happy to help. |
Which version of the AzCopy was used?
10.21.0
Note: The version is visible when running AzCopy without any argument
Which platform are you using? (ex: Windows, Mac, Linux)
Linux
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.
In Fabric notebook, I want to use azcopy via 'AZCOPY_OAUTH_TOKEN_INFO'. 10.18.1 works, but 10.21.0 breaks.
What problem was encountered?
How can we reproduce the problem in the simplest way?
Have you found a mitigation/solution?
The text was updated successfully, but these errors were encountered: