az image
Note
This reference is part of the image-copy-extension extension for the Azure CLI (version 2.68.0 or higher). The extension will automatically install the first time you run an az image command. Learn more about extensions.
Manage custom virtual machine images.
Commands
| Name | Description | Type | Status |
|---|---|---|---|
| az image copy |
Copy a managed image (or vm) to other regions. It requires the source disk to be available. |
Extension | GA |
az image copy
Copy a managed image (or vm) to other regions. It requires the source disk to be available.
az image copy --source-object-name
--source-resource-group
--target-location
--target-resource-group
[--cleanup]
[--export-as-snapshot]
[--parallel-degree]
[--source-type {image, vm}]
[--tags]
[--target-name]
[--target-subscription]
[--temporary-resource-group-name]
[--timeout]
Examples
Copy an image to several regions and cleanup at the end.
az image copy --source-resource-group mySources-rg --source-object-name myImage \
--target-location uksouth northeurope --target-resource-group "images-repo-rg" --cleanup
Use an already generalized vm to create images in other regions.
az image copy --source-resource-group mySources-rg --source-object-name myVm \
--source-type vm --target-location uksouth northeurope --target-resource-group "images-repo-rg"
Required Parameters
The name of the image or vm resource.
Name of the resource group of the source resource.
Space separated location list to create the image in (e.g. westeurope etc.).
Name of the resource group to create images in.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Include this switch to delete temporary resources upon completion.
| Property | Value |
|---|---|
| Default value: | False |
Include this switch to export the copies as snapshots instead of images.
| Property | Value |
|---|---|
| Default value: | False |
Number of parallel copy operations.
| Property | Value |
|---|---|
| Default value: | -1 |
Image or vm.
| Property | Value |
|---|---|
| Default value: | image |
| Accepted values: | image, vm |
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Name of the final image that will be created.
Name or ID of the subscription where the final image should be created.
Resource Group name where temporary storage account will be created.
| Property | Value |
|---|---|
| Default value: | image-copy-rg |
Time in seconds for the copy operation to finish. Increase this time if you are going to copy large images (disks) like 512GB or more.
| Property | Value |
|---|---|
| Default value: | 3600 |
Global Parameters
Increase logging verbosity to show all debug logs.
| Property | Value |
|---|---|
| Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
| Property | Value |
|---|---|
| Default value: | False |
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
| Property | Value |
|---|---|
| Default value: | False |