Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
382 stars 1.23k forks source link

Trying to copy the image to different subscription (different tenant) #1636

Open ghost opened 4 years ago

ghost commented 4 years ago

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az image copy Extension Name: image-copy-extension. Version: 0.2.4.

Errors:

Command '['/opt/az/bin/python3', '-m', 'azure.cli', 'group', 'exists', '--name', 'image-copy-rg', '--output', 'tsv', '--subscription', '46cb9d01-b5d1-4842-8034-748ef91dff6c']' returned non-zero exit status 1.
Traceback (most recent call last):
python3.6/site-packages/knack/cli.py, ln 215, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 631, in execute
    raise ex
...
subprocess.CalledProcessError: Command '['/opt/az/bin/python3', '-m', 'azure.cli', 'group', 'exists', '--name', 'image-copy-rg', '--output', 'tsv', '--subscription', '46cb9d01-b5d1-4842-8034-748ef91dff6c']' returned non-zero exit status 1.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Expected Behavior

Environment Summary

Linux-4.15.0-1077-azure-x86_64-with-debian-stretch-sid
Python 3.6.5
Installer: DEB

azure-cli 2.4.0 *

Extensions:
image-copy-extension 0.2.4

Additional Context

yonzhan commented 4 years ago

@qwordy please take a look

qwordy commented 4 years ago

The error message shows the resource group does not exist. Do you have the correct permission of this resource group and subscription?

ghost commented 4 years ago

it's two different account

qwordy commented 4 years ago

This feature is not officially supported and tested. Theoretically, it can be done if "blob copy" supports cross-tenant copy.

Juliehzl commented 4 years ago

az storage copy supports copy cross tenant if you provide SAS url for source and destination.

yungezz commented 4 years ago

hi @omustafaclassera did you try az storage copy as @Juliehzl suggested? Does it work for you?