[Storage] Fix #32852: az storage copy: Fix Azcopy download link to be using github release links#32868
[Storage] Fix #32852: az storage copy: Fix Azcopy download link to be using github release links#32868
az storage copy: Fix Azcopy download link to be using github release links#32868Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull request overview
Updates the AzCopy self-install logic used by az storage copy to avoid deprecated Azure Front Door blob-hosted download URLs and instead use the current aka.ms/GitHub release-based links.
Changes:
- Switch AzCopy download URLs from the deprecated
azcopyvnext-...azurefd.nethost toaka.ms/downloadazcopy-v10-*links (with existing aka.ms backups retained). - Update download/extraction helper to select zip vs tar.gz based on OS (rather than URL suffix), and add an HTTP status check.
- Adjust error messages and broaden the install-time exception handling.
Comments suppressed due to low confidence (2)
src/azure-cli/azure/cli/command_modules/storage/azcopy/util.py:25
- AZCOPY_VERSION was bumped from 10.13.0 to 10.32.1, which changes the minimum required AzCopy version. This will force a re-download/reinstall for users who already have a previously-supported AzCopy (e.g., 10.13.x) on PATH or in the cached install location, and can break scenarios that rely on preinstalled azcopy or offline builds. Unless there is a specific feature/bugfix requiring 10.32.1, consider keeping AZCOPY_VERSION as the minimum supported version and letting the aka.ms link provide the latest binary.
AZCOPY_VERSION = '10.32.1'
src/azure-cli/azure/cli/command_modules/storage/azcopy/util.py:244
- There’s no unit test coverage for the new download/extraction flow (non-200 responses, zip vs tar.gz selection, redirect/aka.ms behavior, and archive parsing errors). Adding mocked tests around _urlretrieve/_verify_url would help prevent regressions like tarfile parsing errors surfacing as raw tracebacks.
def _urlretrieve(url, install_location, file_extension):
import io
logger.warning('Downloading AzCopy from %s', url)
res = urlopen(url)
if res.status != 200:
raise CLIError('Invalid downloading url {}'.format(url))
compressedFile = io.BytesIO(res.read())
if file_extension == 'zip':
zip_file = zipfile.ZipFile(compressedFile)
for fileName in zip_file.namelist():
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Related command
Description
Fix #32852

In the AzCopy v10.32.0 release notes (link), previous blob links have been deprecated and failed to work anymore.
Changing links to use aka.ms links on https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10

which point to the github release links https://github.com/Azure/azure-storage-azcopy/releases. Keep the backup aka.ms links.
Testing Guide
History Notes
[Storage] Fix #32852:
az storage copy: Fix Azcopy download link to be using github release linksThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.