Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.99k forks source link

'az image create' should fail if image name already exists #5172

Open shaharmor opened 6 years ago

shaharmor commented 6 years ago

When running az image create, if an image with the same name already exists it should fail. What happens today is that the image is not created, but the command finishes successfully and shows the info of the old image.

Environment summary

azure-cli (2.0.23)

acr (2.0.17)
acs (2.0.22)
advisor (0.1.0)
appservice (0.1.22)
backup (1.0.3)
batch (3.1.7)
batchai (0.1.3)
billing (0.1.6)
cdn (0.0.10)
cloud (2.0.10)
cognitiveservices (0.1.9)
command-modules-nspkg (2.0.1)
configure (2.0.12)
consumption (0.2.0)
container (0.1.15)
core (2.0.23)
cosmosdb (0.1.15)
dla (0.0.15)
dls (0.0.18)
eventgrid (0.1.5)
extension (0.0.6)
feedback (2.0.6)
find (0.2.7)
interactive (0.3.11)
iot (0.1.15)
keyvault (2.0.15)
lab (0.0.13)
monitor (0.0.13)
network (2.0.19)
nspkg (3.0.1)
profile (2.0.16)
rdbms (0.0.9)
redis (0.2.10)
reservations (0.1.0)
resource (2.0.19)
role (2.0.15)
servicefabric (0.0.7)
sql (2.0.17)
storage (2.0.21)
vm (2.0.20)

Python location '/usr/local/opt/python3/bin/python3.6'
Extensions directory '/Users/shaharmor/.azure/cliextensions'

Python (Darwin) 3.6.4 (default, Dec 19 2017, 15:24:51)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
yugangw-msft commented 6 years ago

This is not a bug, rather image create uses a PUT hence the command is idempotent like vm create

tjprescott commented 6 years ago

In most cases, PUT operates like "create or replace". In this case, it does not. It's basically a "create or ignore" which is why I marked it as a bug. If you did that with a VM you would get a service error, so there is something here that is not right.

yugangw-msft commented 6 years ago
  What happens today is that the image is not created, but the command finishes successfully and shows the info of the old image.

@shaharmor using --debug flag, could you please share the trace of az image create and az image show (assume it should have 404 )

shaharmor commented 6 years ago

I've done the following:

  1. Created VM named test
  2. Took image of the test VM to an image named test
  3. Destroyed the test VM and all its related resources (Except the image)
  4. Created a new VM named test
  5. Took image of the new test VM to an image named test

I've followed all the steps in this guide: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/capture-image (Deallocate, Generalize, Create image).

You can clearly see that the disk has not been updated in the 2nd run, and its still using the old disk

This is the output of the first az image create run:

 ~ az image create --debug --resource-group my-resource-group --name test --source test
Command arguments ['image', 'create', '--resource-group', 'my-resource-group', '--name', 'test', '--source', 'test']
Loading all installed modules as module with name 'image' not found.
Installed command modules ['acr', 'acs', 'advisor', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'dla', 'dls', 'eventgrid', 'extension', 'feedback', 'find', 'interactive', 'iot', 'keyvault', 'lab', 'monitor', 'network', 'profile', 'rdbms', 'redis', 'reservations', 'resource', 'role', 'servicefabric', 'sql', 'storage', 'vm']
Current cloud config:
{'endpoints': {'active_directory': 'https://login.microsoftonline.com',
               'active_directory_data_lake_resource_id': 'https://datalake.azure.net/',
               'active_directory_graph_resource_id': 'https://graph.windows.net/',
               'active_directory_resource_id': 'https://management.core.windows.net/',
               'batch_resource_id': 'https://batch.core.windows.net/',
               'gallery': 'https://gallery.azure.com/',
               'management': 'https://management.core.windows.net/',
               'resource_manager': 'https://management.azure.com/',
               'sql_management': 'https://management.core.windows.net:8443/',
               'vm_image_alias_doc': 'https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json'},
 'is_active': True,
 'name': 'AzureCloud',
 'profile': 'latest',
 'suffixes': {'azure_datalake_analytics_catalog_and_job_endpoint': 'azuredatalakeanalytics.net',
              'azure_datalake_store_file_system_endpoint': 'azuredatalakestore.net',
              'keyvault_dns': '.vault.azure.net',
              'sql_server_hostname': '.database.windows.net',
              'storage_endpoint': 'core.windows.net'}}
Registered application event handler 'CommandTableParams.Loaded' at <function add_id_parameters at 0x10e10a2f0>
Registered application event handler 'CommandTable.Loaded' at <function add_id_parameters at 0x10e10a2f0>
Loaded module 'acr' in 0.025 seconds.
Loaded module 'acs' in 0.009 seconds.
Loaded module 'advisor' in 0.005 seconds.
Registered application event handler 'CommandParser.Parsing' at <function deprecate at 0x10e14f8c8>
Loaded module 'appservice' in 0.009 seconds.
Loaded module 'backup' in 0.007 seconds.
Loaded module 'batch' in 0.021 seconds.
Loaded module 'batchai' in 0.007 seconds.
Loaded module 'billing' in 0.010 seconds.
Loaded module 'cdn' in 0.012 seconds.
Loaded module 'cloud' in 0.006 seconds.
Loaded module 'cognitiveservices' in 0.007 seconds.
Loaded module 'configure' in 0.005 seconds.
Loaded module 'consumption' in 0.009 seconds.
Loaded module 'container' in 0.003 seconds.
Registered application event handler 'CommandParser.Parsing' at <function deprecate at 0x10e27a0d0>
Loaded module 'cosmosdb' in 0.010 seconds.
Loaded module 'dla' in 0.007 seconds.
Loaded module 'dls' in 0.007 seconds.
Loaded module 'eventgrid' in 0.006 seconds.
Loaded module 'extension' in 0.002 seconds.
Loaded module 'feedback' in 0.006 seconds.
Loaded module 'find' in 0.006 seconds.
Loaded module 'interactive' in 0.006 seconds.
Loaded module 'iot' in 0.010 seconds.
Loaded module 'keyvault' in 0.009 seconds.
Loaded module 'lab' in 0.007 seconds.
Loaded module 'monitor' in 0.012 seconds.
Loaded module 'network' in 0.027 seconds.
Loaded module 'profile' in 0.006 seconds.
Loaded module 'rdbms' in 0.008 seconds.
Loaded module 'redis' in 0.011 seconds.
Loaded module 'reservations' in 0.006 seconds.
Loaded module 'resource' in 0.004 seconds.
Loaded module 'role' in 0.007 seconds.
Loaded module 'servicefabric' in 0.007 seconds.
Loaded module 'sql' in 0.009 seconds.
Loaded module 'storage' in 0.033 seconds.
Loaded module 'vm' in 0.524 seconds.
Loaded all modules in 0.871 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: '/Users/user/.azure/cliextensions'
Application event 'CommandTable.Loaded' with event data {'command_table': {'image create': <azure.cli.core.commands.CliCommand object at 0x10f044da0>}}
Application event 'CommandParser.Loaded' with event data {'parser': AzCliCommandParser(prog='az', usage=None, description=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)}
Application event 'CommandTableParams.Loaded' with event data {'command_table': {'image create': <azure.cli.core.commands.CliCommand object at 0x10f044da0>}}
Application event 'CommandParser.Parsing' with event data {'argv': ['image', 'create', '--resource-group', 'my-resource-group', '--name', 'test', '--source', 'test']}
Application event 'CommandParser.Parsed' with event data {'command': 'image create', 'args': Namespace(_command_package='image', _jmespath_query=None, _log_verbosity_debug=False, _log_verbosity_verbose=False, _output_format='json', _parser=AzCliCommandParser(prog='az image create', usage=None, description='', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True), _validators=[<function process_image_create_namespace at 0x10f127268>, <function validate_tags at 0x10e232d90>], command='image create', data_blob_u [...]
Getting management service client client_type=ComputeManagementClient
attempting to read file /Users/user/.azure/accessTokens.json as utf-8-sig
adal-python : c13fdefb-3d87-4adc-8e32-dc81d583d495 - Authority:Performing instance discovery: https://login.microsoftonline.com/00bb54b2-2e46-41f0-8d7d-be73e0fbb027
adal-python : c13fdefb-3d87-4adc-8e32-dc81d583d495 - Authority:Performing static instance discovery
adal-python : c13fdefb-3d87-4adc-8e32-dc81d583d495 - Authority:Authority validated via static instance discovery
adal-python : c13fdefb-3d87-4adc-8e32-dc81d583d495 - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : c13fdefb-3d87-4adc-8e32-dc81d583d495 - OAuth2Client:finding with query: {"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : c13fdefb-3d87-4adc-8e32-dc81d583d495 - OAuth2Client:Looking for potential cache entries:
adal-python : c13fdefb-3d87-4adc-8e32-dc81d583d495 - OAuth2Client:{"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : c13fdefb-3d87-4adc-8e32-dc81d583d495 - OAuth2Client:Found 3 potential entries.
adal-python : c13fdefb-3d87-4adc-8e32-dc81d583d495 - OAuth2Client:Resource specific token found.
adal-python : c13fdefb-3d87-4adc-8e32-dc81d583d495 - OAuth2Client:Returning token from cache lookup, AccessTokenId: b'xxxxx', RefreshTokenId: b'xxxxx'
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test?api-version=2017-12-01 HTTP/1.1" 200 None
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test?api-version=2017-12-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger :     'User-Agent': 'python/3.6.4 (Darwin-16.7.0-x86_64-i386-64bit) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 computemanagementclient/3.1.0rc2 Azure-SDK-For-Python AZURECLI/2.0.23'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Authorization': '*****'
msrest.http_logger :     'x-ms-client-request-id': '8b129e4c-f514-11e7-8cb7-a45e60c0aaf3'
msrest.http_logger :     'CommandName': 'image create'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Transfer-Encoding': 'chunked'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Content-Encoding': 'gzip'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Vary': 'Accept-Encoding'
msrest.http_logger :     'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/LowCostGet3Min;4785,Microsoft.Compute/LowCostGet30Min;38286'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'x-ms-served-by': '8cc491b3-c524-4526-a3ad-3c75fcdc0a3c_131542262855793710'
msrest.http_logger :     'x-ms-request-id': '6d89d1d7-d887-4aec-a5cf-86eb6c1aa370'
msrest.http_logger :     'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-reads': '14990'
msrest.http_logger :     'x-ms-correlation-request-id': '89b3484b-8596-415c-906c-e7a0010524d7'
msrest.http_logger :     'x-ms-routing-request-id': 'WESTEUROPE:20180109T081026Z:89b3484b-8596-415c-906c-e7a0010524d7'
msrest.http_logger :     'Date': 'Tue, 09 Jan 2018 08:10:26 GMT'
msrest.http_logger : Response content:
msrest.http_logger : b'{\r\n  "properties": {\r\n    "vmId": "553c1564-53e8-491b-ae49-9b0d6a6281a5",\r\n    "hardwareProfile": {\r\n      "vmSize": "Standard_DS1_v2"\r\n    },\r\n    "storageProfile": {\r\n      "imageReference": {\r\n        "publisher": "Canonical",\r\n        "offer": "userServer",\r\n        "sku": "16.04-LTS",\r\n        "version": "latest"\r\n      },\r\n      "osDisk": {\r\n        "osType": "Linux",\r\n        "name": "test_OsDisk_1_c20b4c826d9f49a6b74536bb0394fe6b",\r\n        "createOption": "FromImage",\r\n        "caching": "ReadWrite",\r\n        "managedDisk": {\r\n          "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/disks/test_OsDisk_1_c20b4c826d9f49a6b74536bb0394fe6b"\r\n        }\r\n      },\r\n      "dataDisks": []\r\n    },\r\n    "osProfile": {\r\n      "computerName": "test",\r\n      "adminUsername": "user",\r\n      "linuxConfiguration": {\r\n        "disablePasswordAuthentication": true,\r\n        "ssh": {\r\n          "publicKeys": [\r\n            {\r\n              "path": "/home/user/.ssh/authorized_keys",\r\n              "keyData": "ssh-rsa xxx"\r\n            }\r\n          ]\r\n        }\r\n      },\r\n      "secrets": []\r\n    },\r\n    "networkProfile": {"networkInterfaces":[{"id":"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Network/networkInterfaces/test26"}]},\r\n    "provisioningState": "Succeeded"\r\n  },\r\n  "type": "Microsoft.Compute/virtualMachines",\r\n  "location": "westeurope",\r\n  "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test",\r\n  "name": "test"\r\n}'
Getting management service client client_type=ResourceManagementClient
adal-python : 038fb8a1-be47-408e-9971-db32ce2a19ec - Authority:Performing instance discovery: https://login.microsoftonline.com/00bb54b2-2e46-41f0-8d7d-be73e0fbb027
adal-python : 038fb8a1-be47-408e-9971-db32ce2a19ec - Authority:Performing static instance discovery
adal-python : 038fb8a1-be47-408e-9971-db32ce2a19ec - Authority:Authority validated via static instance discovery
adal-python : 038fb8a1-be47-408e-9971-db32ce2a19ec - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : 038fb8a1-be47-408e-9971-db32ce2a19ec - OAuth2Client:finding with query: {"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : 038fb8a1-be47-408e-9971-db32ce2a19ec - OAuth2Client:Looking for potential cache entries:
adal-python : 038fb8a1-be47-408e-9971-db32ce2a19ec - OAuth2Client:{"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : 038fb8a1-be47-408e-9971-db32ce2a19ec - OAuth2Client:Found 3 potential entries.
adal-python : 038fb8a1-be47-408e-9971-db32ce2a19ec - OAuth2Client:Resource specific token found.
adal-python : 038fb8a1-be47-408e-9971-db32ce2a19ec - OAuth2Client:Returning token from cache lookup, AccessTokenId: b'xxxxx', RefreshTokenId: b'xxxxx'
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/my-resource-group?api-version=2017-05-10 HTTP/1.1" 200 259
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/my-resource-group?api-version=2017-05-10'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger :     'User-Agent': 'python/3.6.4 (Darwin-16.7.0-x86_64-i386-64bit) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python AZURECLI/2.0.23'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Authorization': '*****'
msrest.http_logger :     'x-ms-client-request-id': '8b129e4c-f514-11e7-8cb7-a45e60c0aaf3'
msrest.http_logger :     'CommandName': 'image create'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Content-Encoding': 'gzip'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Vary': 'Accept-Encoding'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-reads': '14983'
msrest.http_logger :     'x-ms-request-id': 'b65e1ac9-f954-41f7-9717-cf483c5707ad'
msrest.http_logger :     'x-ms-correlation-request-id': 'b65e1ac9-f954-41f7-9717-cf483c5707ad'
msrest.http_logger :     'x-ms-routing-request-id': 'WESTEUROPE:20180109T081027Z:b65e1ac9-f954-41f7-9717-cf483c5707ad'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'Date': 'Tue, 09 Jan 2018 08:10:26 GMT'
msrest.http_logger :     'Content-Length': '259'
msrest.http_logger : Response content:
msrest.http_logger : b'{"id":"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group","name":"my-resource-group","location":"westeurope","properties":{"provisioningState":"Succeeded"}}'
Getting management service client client_type=ComputeManagementClient
adal-python : e19dee17-fc44-44ef-93dc-b0a6a3c14b71 - Authority:Performing instance discovery: https://login.microsoftonline.com/00bb54b2-2e46-41f0-8d7d-be73e0fbb027
adal-python : e19dee17-fc44-44ef-93dc-b0a6a3c14b71 - Authority:Performing static instance discovery
adal-python : e19dee17-fc44-44ef-93dc-b0a6a3c14b71 - Authority:Authority validated via static instance discovery
adal-python : e19dee17-fc44-44ef-93dc-b0a6a3c14b71 - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : e19dee17-fc44-44ef-93dc-b0a6a3c14b71 - OAuth2Client:finding with query: {"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : e19dee17-fc44-44ef-93dc-b0a6a3c14b71 - OAuth2Client:Looking for potential cache entries:
adal-python : e19dee17-fc44-44ef-93dc-b0a6a3c14b71 - OAuth2Client:{"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : e19dee17-fc44-44ef-93dc-b0a6a3c14b71 - OAuth2Client:Found 3 potential entries.
adal-python : e19dee17-fc44-44ef-93dc-b0a6a3c14b71 - OAuth2Client:Resource specific token found.
adal-python : e19dee17-fc44-44ef-93dc-b0a6a3c14b71 - OAuth2Client:Returning token from cache lookup, AccessTokenId: b'xxxxx', RefreshTokenId: b'xxxxx'
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "PUT /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test?api-version=2017-12-01 HTTP/1.1" 201 862
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test?api-version=2017-12-01'
msrest.http_logger : Request method: 'PUT'
msrest.http_logger : Request headers:
msrest.http_logger :     'User-Agent': 'python/3.6.4 (Darwin-16.7.0-x86_64-i386-64bit) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 computemanagementclient/3.1.0rc2 Azure-SDK-For-Python AZURECLI/2.0.23'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Authorization': '*****'
msrest.http_logger :     'x-ms-client-request-id': '8b129e4c-f514-11e7-8cb7-a45e60c0aaf3'
msrest.http_logger :     'CommandName': 'image create'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger :     'Content-Length': '205'
msrest.http_logger : Request body:
msrest.http_logger : {"location": "westeurope", "properties": {"sourceVirtualMachine": {"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test"}}}
msrest.http_logger : Response status: 201
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Content-Length': '862'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Azure-AsyncOperation': 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Compute/locations/westeurope/operations/e91e2bea-009a-4653-8ae6-532dd6a04ef5?api-version=2017-12-01'
msrest.http_logger :     'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/CreateImages3Min;38,Microsoft.Compute/CreateImages30Min;198'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'x-ms-served-by': '8cc491b3-c524-4526-a3ad-3c75fcdc0a3c_131542262855793710'
msrest.http_logger :     'x-ms-request-id': 'e91e2bea-009a-4653-8ae6-532dd6a04ef5'
msrest.http_logger :     'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-writes': '1199'
msrest.http_logger :     'x-ms-correlation-request-id': 'a44a1c18-5895-44fe-b23c-3859466ba8e2'
msrest.http_logger :     'x-ms-routing-request-id': 'WESTEUROPE:20180109T081028Z:a44a1c18-5895-44fe-b23c-3859466ba8e2'
msrest.http_logger :     'Date': 'Tue, 09 Jan 2018 08:10:28 GMT'
msrest.http_logger : Response content:
msrest.http_logger : b'{\r\n  "properties": {\r\n    "sourceVirtualMachine": {\r\n      "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test"\r\n    },\r\n    "storageProfile": {\r\n      "osDisk": {\r\n        "osType": "Linux",\r\n        "osState": "Generalized",\r\n        "managedDisk": {\r\n          "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/disks/test_OsDisk_1_c20b4c826d9f49a6b74536bb0394fe6b"\r\n        },\r\n        "caching": "ReadWrite"\r\n      },\r\n      "dataDisks": []\r\n    },\r\n    "provisioningState": "Creating"\r\n  },\r\n  "type": "Microsoft.Compute/images",\r\n  "location": "westeurope",\r\n  "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test",\r\n  "name": "test"\r\n}'
adal-python : 0d1983fb-2cd9-4f56-9a86-7084b9445abd - Authority:Performing instance discovery: https://login.microsoftonline.com/00bb54b2-2e46-41f0-8d7d-be73e0fbb027
adal-python : 0d1983fb-2cd9-4f56-9a86-7084b9445abd - Authority:Performing static instance discovery
adal-python : 0d1983fb-2cd9-4f56-9a86-7084b9445abd - Authority:Authority validated via static instance discovery
adal-python : 0d1983fb-2cd9-4f56-9a86-7084b9445abd - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : 0d1983fb-2cd9-4f56-9a86-7084b9445abd - OAuth2Client:finding with query: {"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : 0d1983fb-2cd9-4f56-9a86-7084b9445abd - OAuth2Client:Looking for potential cache entries:
adal-python : 0d1983fb-2cd9-4f56-9a86-7084b9445abd - OAuth2Client:{"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : 0d1983fb-2cd9-4f56-9a86-7084b9445abd - OAuth2Client:Found 3 potential entries.
adal-python : 0d1983fb-2cd9-4f56-9a86-7084b9445abd - OAuth2Client:Resource specific token found.
adal-python : 0d1983fb-2cd9-4f56-9a86-7084b9445abd - OAuth2Client:Returning token from cache lookup, AccessTokenId: b'xxxxx', RefreshTokenId: b'xxxxx'
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Compute/locations/westeurope/operations/e91e2bea-009a-4653-8ae6-532dd6a04ef5?api-version=2017-12-01 HTTP/1.1" 200 None
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Compute/locations/westeurope/operations/e91e2bea-009a-4653-8ae6-532dd6a04ef5?api-version=2017-12-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger :     'User-Agent': 'python/3.6.4 (Darwin-16.7.0-x86_64-i386-64bit) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 computemanagementclient/3.1.0rc2 Azure-SDK-For-Python AZURECLI/2.0.23'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Authorization': '*****'
msrest.http_logger :     'x-ms-client-request-id': '8b129e4c-f514-11e7-8cb7-a45e60c0aaf3'
msrest.http_logger :     'CommandName': 'image create'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Transfer-Encoding': 'chunked'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Content-Encoding': 'gzip'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Vary': 'Accept-Encoding'
msrest.http_logger :     'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/GetOperation3Min;11996,Microsoft.Compute/GetOperation30Min;23967'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'x-ms-served-by': '8cc491b3-c524-4526-a3ad-3c75fcdc0a3c_131542262855793710'
msrest.http_logger :     'x-ms-request-id': 'b1c74982-8dfd-4c2c-aecf-74a58a6235cc'
msrest.http_logger :     'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-reads': '14988'
msrest.http_logger :     'x-ms-correlation-request-id': 'e89beb9d-81f2-478d-94ee-cfdb1db81144'
msrest.http_logger :     'x-ms-routing-request-id': 'WESTEUROPE:20180109T081059Z:e89beb9d-81f2-478d-94ee-cfdb1db81144'
msrest.http_logger :     'Date': 'Tue, 09 Jan 2018 08:10:58 GMT'
msrest.http_logger : Response content:
msrest.http_logger : b'{\r\n  "startTime": "2018-01-09T08:10:27.7959404+00:00",\r\n  "endTime": "2018-01-09T08:10:32.9366043+00:00",\r\n  "status": "Succeeded",\r\n  "name": "e91e2bea-009a-4653-8ae6-532dd6a04ef5"\r\n}'
adal-python : 5171aca8-5251-45d3-9111-9b9b9d0a49c4 - Authority:Performing instance discovery: https://login.microsoftonline.com/00bb54b2-2e46-41f0-8d7d-be73e0fbb027
adal-python : 5171aca8-5251-45d3-9111-9b9b9d0a49c4 - Authority:Performing static instance discovery
adal-python : 5171aca8-5251-45d3-9111-9b9b9d0a49c4 - Authority:Authority validated via static instance discovery
adal-python : 5171aca8-5251-45d3-9111-9b9b9d0a49c4 - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : 5171aca8-5251-45d3-9111-9b9b9d0a49c4 - OAuth2Client:finding with query: {"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : 5171aca8-5251-45d3-9111-9b9b9d0a49c4 - OAuth2Client:Looking for potential cache entries:
adal-python : 5171aca8-5251-45d3-9111-9b9b9d0a49c4 - OAuth2Client:{"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : 5171aca8-5251-45d3-9111-9b9b9d0a49c4 - OAuth2Client:Found 3 potential entries.
adal-python : 5171aca8-5251-45d3-9111-9b9b9d0a49c4 - OAuth2Client:Resource specific token found.
adal-python : 5171aca8-5251-45d3-9111-9b9b9d0a49c4 - OAuth2Client:Returning token from cache lookup, AccessTokenId: b'xxxxx', RefreshTokenId: b'xxxxx'
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test?api-version=2017-12-01 HTTP/1.1" 200 None
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test?api-version=2017-12-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger :     'User-Agent': 'python/3.6.4 (Darwin-16.7.0-x86_64-i386-64bit) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 computemanagementclient/3.1.0rc2 Azure-SDK-For-Python AZURECLI/2.0.23'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Authorization': '*****'
msrest.http_logger :     'x-ms-client-request-id': '8b129e4c-f514-11e7-8cb7-a45e60c0aaf3'
msrest.http_logger :     'CommandName': 'image create'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Transfer-Encoding': 'chunked'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Content-Encoding': 'gzip'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Vary': 'Accept-Encoding'
msrest.http_logger :     'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/GetImages3Min;346,Microsoft.Compute/GetImages30Min;1774'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'x-ms-served-by': '8cc491b3-c524-4526-a3ad-3c75fcdc0a3c_131542262855793710'
msrest.http_logger :     'x-ms-request-id': '9b0e5600-46a2-47cf-ac46-30aeedaf1e2f'
msrest.http_logger :     'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-reads': '14989'
msrest.http_logger :     'x-ms-correlation-request-id': '29f5fe70-a3e4-4533-b9d1-69c5a9c03495'
msrest.http_logger :     'x-ms-routing-request-id': 'WESTEUROPE:20180109T081059Z:29f5fe70-a3e4-4533-b9d1-69c5a9c03495'
msrest.http_logger :     'Date': 'Tue, 09 Jan 2018 08:10:58 GMT'
msrest.http_logger : Response content:
msrest.http_logger : b'{\r\n  "properties": {\r\n    "sourceVirtualMachine": {\r\n      "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test"\r\n    },\r\n    "storageProfile": {\r\n      "osDisk": {\r\n        "osType": "Linux",\r\n        "osState": "Generalized",\r\n        "diskSizeGB": 30,\r\n        "managedDisk": {\r\n          "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/disks/test_OsDisk_1_c20b4c826d9f49a6b74536bb0394fe6b"\r\n        },\r\n        "caching": "ReadWrite",\r\n        "storageAccountType": "Standard_LRS"\r\n      },\r\n      "dataDisks": []\r\n    },\r\n    "provisioningState": "Succeeded"\r\n  },\r\n  "type": "Microsoft.Compute/images",\r\n  "location": "westeurope",\r\n  "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test",\r\n  "name": "test"\r\n}'
Application event 'Application.TransformResults' with event data {'event_data': {'result': {'additionalProperties': {}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test', 'name': 'test', 'type': 'Microsoft.Compute/images', 'location': 'westeurope', 'tags': None, 'sourceVirtualMachine': {'additionalProperties': {}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test'}, 'storageProfile': {'addition [...]
Application event 'Application.FilterResults' with event data {'event_data': {'result': {'additionalProperties': {}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test', 'name': 'test', 'type': 'Microsoft.Compute/images', 'location': 'westeurope', 'tags': None, 'sourceVirtualMachine': {'additionalProperties': {}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test', 'resourceGroup': 'my-resource-group [...]
{
  "additionalProperties": {},
  "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test",
  "location": "westeurope",
  "name": "test",
  "provisioningState": "Succeeded",
  "resourceGroup": "my-resource-group",
  "sourceVirtualMachine": {
    "additionalProperties": {},
    "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test",
    "resourceGroup": "my-resource-group"
  },
  "storageProfile": {
    "additionalProperties": {},
    "dataDisks": [],
    "osDisk": {
      "additionalProperties": {},
      "blobUri": null,
      "caching": "ReadWrite",
      "diskSizeGb": 30,
      "managedDisk": {
        "additionalProperties": {},
        "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/disks/test_OsDisk_1_c20b4c826d9f49a6b74536bb0394fe6b",
        "resourceGroup": "my-resource-group"
      },
      "osState": "Generalized",
      "osType": "Linux",
      "snapshot": null,
      "storageAccountType": "Standard_LRS"
    }
  },
  "tags": null,
  "type": "Microsoft.Compute/images"
}

This is the output of the second az image create run:

~ az image create --debug --resource-group my-resource-group --name test --source test
Command arguments ['image', 'create', '--resource-group', 'my-resource-group', '--name', 'test', '--source', 'test']
Loading all installed modules as module with name 'image' not found.
Installed command modules ['acr', 'acs', 'advisor', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'dla', 'dls', 'eventgrid', 'extension', 'feedback', 'find', 'interactive', 'iot', 'keyvault', 'lab', 'monitor', 'network', 'profile', 'rdbms', 'redis', 'reservations', 'resource', 'role', 'servicefabric', 'sql', 'storage', 'vm']
Current cloud config:
{'endpoints': {'active_directory': 'https://login.microsoftonline.com',
               'active_directory_data_lake_resource_id': 'https://datalake.azure.net/',
               'active_directory_graph_resource_id': 'https://graph.windows.net/',
               'active_directory_resource_id': 'https://management.core.windows.net/',
               'batch_resource_id': 'https://batch.core.windows.net/',
               'gallery': 'https://gallery.azure.com/',
               'management': 'https://management.core.windows.net/',
               'resource_manager': 'https://management.azure.com/',
               'sql_management': 'https://management.core.windows.net:8443/',
               'vm_image_alias_doc': 'https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json'},
 'is_active': True,
 'name': 'AzureCloud',
 'profile': 'latest',
 'suffixes': {'azure_datalake_analytics_catalog_and_job_endpoint': 'azuredatalakeanalytics.net',
              'azure_datalake_store_file_system_endpoint': 'azuredatalakestore.net',
              'keyvault_dns': '.vault.azure.net',
              'sql_server_hostname': '.database.windows.net',
              'storage_endpoint': 'core.windows.net'}}
Registered application event handler 'CommandTableParams.Loaded' at <function add_id_parameters at 0x1109e42f0>
Registered application event handler 'CommandTable.Loaded' at <function add_id_parameters at 0x1109e42f0>
Loaded module 'acr' in 0.015 seconds.
Loaded module 'acs' in 0.008 seconds.
Loaded module 'advisor' in 0.006 seconds.
Registered application event handler 'CommandParser.Parsing' at <function deprecate at 0x110a298c8>
Loaded module 'appservice' in 0.009 seconds.
Loaded module 'backup' in 0.003 seconds.
Loaded module 'batch' in 0.018 seconds.
Loaded module 'batchai' in 0.007 seconds.
Loaded module 'billing' in 0.007 seconds.
Loaded module 'cdn' in 0.012 seconds.
Loaded module 'cloud' in 0.002 seconds.
Loaded module 'cognitiveservices' in 0.008 seconds.
Loaded module 'configure' in 0.007 seconds.
Loaded module 'consumption' in 0.006 seconds.
Loaded module 'container' in 0.009 seconds.
Registered application event handler 'CommandParser.Parsing' at <function deprecate at 0x110b540d0>
Loaded module 'cosmosdb' in 0.012 seconds.
Loaded module 'dla' in 0.007 seconds.
Loaded module 'dls' in 0.003 seconds.
Loaded module 'eventgrid' in 0.006 seconds.
Loaded module 'extension' in 0.005 seconds.
Loaded module 'feedback' in 0.005 seconds.
Loaded module 'find' in 0.005 seconds.
Loaded module 'interactive' in 0.005 seconds.
Loaded module 'iot' in 0.010 seconds.
Loaded module 'keyvault' in 0.004 seconds.
Loaded module 'lab' in 0.005 seconds.
Loaded module 'monitor' in 0.011 seconds.
Loaded module 'network' in 0.027 seconds.
Loaded module 'profile' in 0.005 seconds.
Loaded module 'rdbms' in 0.008 seconds.
Loaded module 'redis' in 0.012 seconds.
Loaded module 'reservations' in 0.007 seconds.
Loaded module 'resource' in 0.008 seconds.
Loaded module 'role' in 0.007 seconds.
Loaded module 'servicefabric' in 0.007 seconds.
Loaded module 'sql' in 0.011 seconds.
Loaded module 'storage' in 0.033 seconds.
Loaded module 'vm' in 0.220 seconds.
Loaded all modules in 0.539 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: '/Users/user/.azure/cliextensions'
Application event 'CommandTable.Loaded' with event data {'command_table': {'image create': <azure.cli.core.commands.CliCommand object at 0x11191eda0>}}
Application event 'CommandParser.Loaded' with event data {'parser': AzCliCommandParser(prog='az', usage=None, description=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)}
Application event 'CommandTableParams.Loaded' with event data {'command_table': {'image create': <azure.cli.core.commands.CliCommand object at 0x11191eda0>}}
Application event 'CommandParser.Parsing' with event data {'argv': ['image', 'create', '--resource-group', 'my-resource-group', '--name', 'test', '--source', 'test']}
Application event 'CommandParser.Parsed' with event data {'command': 'image create', 'args': Namespace(_command_package='image', _jmespath_query=None, _log_verbosity_debug=False, _log_verbosity_verbose=False, _output_format='json', _parser=AzCliCommandParser(prog='az image create', usage=None, description='', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True), _validators=[<function process_image_create_namespace at 0x111a01268>, <function validate_tags at 0x110b0cd90>], command='image create', data_blob_u [...]
Getting management service client client_type=ComputeManagementClient
attempting to read file /Users/user/.azure/accessTokens.json as utf-8-sig
adal-python : 2420accd-a3ca-40aa-8ccd-58829a9a4509 - Authority:Performing instance discovery: https://login.microsoftonline.com/00bb54b2-2e46-41f0-8d7d-be73e0fbb027
adal-python : 2420accd-a3ca-40aa-8ccd-58829a9a4509 - Authority:Performing static instance discovery
adal-python : 2420accd-a3ca-40aa-8ccd-58829a9a4509 - Authority:Authority validated via static instance discovery
adal-python : 2420accd-a3ca-40aa-8ccd-58829a9a4509 - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : 2420accd-a3ca-40aa-8ccd-58829a9a4509 - OAuth2Client:finding with query: {"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : 2420accd-a3ca-40aa-8ccd-58829a9a4509 - OAuth2Client:Looking for potential cache entries:
adal-python : 2420accd-a3ca-40aa-8ccd-58829a9a4509 - OAuth2Client:{"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : 2420accd-a3ca-40aa-8ccd-58829a9a4509 - OAuth2Client:Found 3 potential entries.
adal-python : 2420accd-a3ca-40aa-8ccd-58829a9a4509 - OAuth2Client:Resource specific token found.
adal-python : 2420accd-a3ca-40aa-8ccd-58829a9a4509 - OAuth2Client:Returning token from cache lookup, AccessTokenId: b'xxxxx', RefreshTokenId: b'xxxxx'
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test?api-version=2017-12-01 HTTP/1.1" 200 None
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test?api-version=2017-12-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger :     'User-Agent': 'python/3.6.4 (Darwin-16.7.0-x86_64-i386-64bit) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 computemanagementclient/3.1.0rc2 Azure-SDK-For-Python AZURECLI/2.0.23'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Authorization': '*****'
msrest.http_logger :     'x-ms-client-request-id': 'e8301262-f516-11e7-9ace-a45e60c0aaf3'
msrest.http_logger :     'CommandName': 'image create'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Transfer-Encoding': 'chunked'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Content-Encoding': 'gzip'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Vary': 'Accept-Encoding'
msrest.http_logger :     'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/LowCostGet3Min;4799,Microsoft.Compute/LowCostGet30Min;38269'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'x-ms-served-by': '8cc491b3-c524-4526-a3ad-3c75fcdc0a3c_131542262855793710'
msrest.http_logger :     'x-ms-request-id': '4465cdcb-e11c-49af-bb8b-d620dce7a083'
msrest.http_logger :     'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-reads': '14978'
msrest.http_logger :     'x-ms-correlation-request-id': 'd1b2315d-e9d8-4044-9f9c-980c130009f4'
msrest.http_logger :     'x-ms-routing-request-id': 'WESTEUROPE:20180109T082721Z:d1b2315d-e9d8-4044-9f9c-980c130009f4'
msrest.http_logger :     'Date': 'Tue, 09 Jan 2018 08:27:20 GMT'
msrest.http_logger : Response content:
msrest.http_logger : b'{\r\n  "properties": {\r\n    "vmId": "0e4b3b58-d34d-43d0-b4eb-a7e357ad20c7",\r\n    "hardwareProfile": {\r\n      "vmSize": "Standard_D1_v2"\r\n    },\r\n    "storageProfile": {\r\n      "imageReference": {\r\n        "publisher": "Canonical",\r\n        "offer": "userServer",\r\n        "sku": "16.04-LTS",\r\n        "version": "latest"\r\n      },\r\n      "osDisk": {\r\n        "osType": "Linux",\r\n        "name": "test_OsDisk_1_ab4b1ab955394815ba9e55bf08a816c6",\r\n        "createOption": "FromImage",\r\n        "caching": "ReadWrite",\r\n        "managedDisk": {\r\n          "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/disks/test_OsDisk_1_ab4b1ab955394815ba9e55bf08a816c6"\r\n        }\r\n      },\r\n      "dataDisks": []\r\n    },\r\n    "osProfile": {\r\n      "computerName": "test",\r\n      "adminUsername": "user",\r\n      "linuxConfiguration": {\r\n        "disablePasswordAuthentication": true,\r\n        "ssh": {\r\n          "publicKeys": [\r\n            {\r\n              "path": "/home/user/.ssh/authorized_keys",\r\n              "keyData": "ssh-rsa xxx"\r\n            }\r\n          ]\r\n        }\r\n      },\r\n      "secrets": []\r\n    },\r\n    "networkProfile": {"networkInterfaces":[{"id":"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Network/networkInterfaces/test873"}]},\r\n    "provisioningState": "Succeeded"\r\n  },\r\n  "type": "Microsoft.Compute/virtualMachines",\r\n  "location": "westeurope",\r\n  "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test",\r\n  "name": "test"\r\n}'
Getting management service client client_type=ResourceManagementClient
adal-python : 1408241e-3e89-4cc8-9956-326fe61268c2 - Authority:Performing instance discovery: https://login.microsoftonline.com/00bb54b2-2e46-41f0-8d7d-be73e0fbb027
adal-python : 1408241e-3e89-4cc8-9956-326fe61268c2 - Authority:Performing static instance discovery
adal-python : 1408241e-3e89-4cc8-9956-326fe61268c2 - Authority:Authority validated via static instance discovery
adal-python : 1408241e-3e89-4cc8-9956-326fe61268c2 - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : 1408241e-3e89-4cc8-9956-326fe61268c2 - OAuth2Client:finding with query: {"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : 1408241e-3e89-4cc8-9956-326fe61268c2 - OAuth2Client:Looking for potential cache entries:
adal-python : 1408241e-3e89-4cc8-9956-326fe61268c2 - OAuth2Client:{"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : 1408241e-3e89-4cc8-9956-326fe61268c2 - OAuth2Client:Found 3 potential entries.
adal-python : 1408241e-3e89-4cc8-9956-326fe61268c2 - OAuth2Client:Resource specific token found.
adal-python : 1408241e-3e89-4cc8-9956-326fe61268c2 - OAuth2Client:Returning token from cache lookup, AccessTokenId: b'xxxxx', RefreshTokenId: b'xxxxx'
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/my-resource-group?api-version=2017-05-10 HTTP/1.1" 200 259
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/my-resource-group?api-version=2017-05-10'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger :     'User-Agent': 'python/3.6.4 (Darwin-16.7.0-x86_64-i386-64bit) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python AZURECLI/2.0.23'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Authorization': '*****'
msrest.http_logger :     'x-ms-client-request-id': 'e8301262-f516-11e7-9ace-a45e60c0aaf3'
msrest.http_logger :     'CommandName': 'image create'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Content-Encoding': 'gzip'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Vary': 'Accept-Encoding'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-reads': '14978'
msrest.http_logger :     'x-ms-request-id': '37f60c8c-13c6-4ef6-bb81-b17d1ca25ddd'
msrest.http_logger :     'x-ms-correlation-request-id': '37f60c8c-13c6-4ef6-bb81-b17d1ca25ddd'
msrest.http_logger :     'x-ms-routing-request-id': 'WESTEUROPE:20180109T082721Z:37f60c8c-13c6-4ef6-bb81-b17d1ca25ddd'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'Date': 'Tue, 09 Jan 2018 08:27:21 GMT'
msrest.http_logger :     'Content-Length': '259'
msrest.http_logger : Response content:
msrest.http_logger : b'{"id":"/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group","name":"my-resource-group","location":"westeurope","properties":{"provisioningState":"Succeeded"}}'
Getting management service client client_type=ComputeManagementClient
adal-python : f4b1ba65-9428-4d18-a990-44526032d00d - Authority:Performing instance discovery: https://login.microsoftonline.com/00bb54b2-2e46-41f0-8d7d-be73e0fbb027
adal-python : f4b1ba65-9428-4d18-a990-44526032d00d - Authority:Performing static instance discovery
adal-python : f4b1ba65-9428-4d18-a990-44526032d00d - Authority:Authority validated via static instance discovery
adal-python : f4b1ba65-9428-4d18-a990-44526032d00d - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : f4b1ba65-9428-4d18-a990-44526032d00d - OAuth2Client:finding with query: {"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : f4b1ba65-9428-4d18-a990-44526032d00d - OAuth2Client:Looking for potential cache entries:
adal-python : f4b1ba65-9428-4d18-a990-44526032d00d - OAuth2Client:{"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : f4b1ba65-9428-4d18-a990-44526032d00d - OAuth2Client:Found 3 potential entries.
adal-python : f4b1ba65-9428-4d18-a990-44526032d00d - OAuth2Client:Resource specific token found.
adal-python : f4b1ba65-9428-4d18-a990-44526032d00d - OAuth2Client:Returning token from cache lookup, AccessTokenId: b'xxxxx', RefreshTokenId: b'xxxxx'
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "PUT /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test?api-version=2017-12-01 HTTP/1.1" 200 None
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test?api-version=2017-12-01'
msrest.http_logger : Request method: 'PUT'
msrest.http_logger : Request headers:
msrest.http_logger :     'User-Agent': 'python/3.6.4 (Darwin-16.7.0-x86_64-i386-64bit) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 computemanagementclient/3.1.0rc2 Azure-SDK-For-Python AZURECLI/2.0.23'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Authorization': '*****'
msrest.http_logger :     'x-ms-client-request-id': 'e8301262-f516-11e7-9ace-a45e60c0aaf3'
msrest.http_logger :     'CommandName': 'image create'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger :     'Content-Length': '205'
msrest.http_logger : Request body:
msrest.http_logger : {"location": "westeurope", "properties": {"sourceVirtualMachine": {"id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test"}}}
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Transfer-Encoding': 'chunked'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Content-Encoding': 'gzip'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Vary': 'Accept-Encoding'
msrest.http_logger :     'Azure-AsyncOperation': 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Compute/locations/westeurope/operations/c44eaa36-9566-49f1-90f1-f1e95c9df87f?api-version=2017-12-01'
msrest.http_logger :     'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/CreateImages3Min;39,Microsoft.Compute/CreateImages30Min;196'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'x-ms-served-by': '8cc491b3-c524-4526-a3ad-3c75fcdc0a3c_131542262855793710'
msrest.http_logger :     'x-ms-request-id': 'c44eaa36-9566-49f1-90f1-f1e95c9df87f'
msrest.http_logger :     'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-writes': '1198'
msrest.http_logger :     'x-ms-correlation-request-id': '1569bf09-6906-47c8-a678-8e4c7fd1b1c5'
msrest.http_logger :     'x-ms-routing-request-id': 'WESTEUROPE:20180109T082722Z:1569bf09-6906-47c8-a678-8e4c7fd1b1c5'
msrest.http_logger :     'Date': 'Tue, 09 Jan 2018 08:27:22 GMT'
msrest.http_logger : Response content:
msrest.http_logger : b'{\r\n  "properties": {\r\n    "sourceVirtualMachine": {\r\n      "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test"\r\n    },\r\n    "storageProfile": {\r\n      "osDisk": {\r\n        "osType": "Linux",\r\n        "osState": "Generalized",\r\n        "diskSizeGB": 30,\r\n        "managedDisk": {\r\n          "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/disks/test_OsDisk_1_c20b4c826d9f49a6b74536bb0394fe6b"\r\n        },\r\n        "caching": "ReadWrite",\r\n        "storageAccountType": "Standard_LRS"\r\n      },\r\n      "dataDisks": []\r\n    },\r\n    "provisioningState": "Succeeded"\r\n  },\r\n  "type": "Microsoft.Compute/images",\r\n  "location": "westeurope",\r\n  "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test",\r\n  "name": "test"\r\n}'
adal-python : 1887e92d-1bf0-40ce-aad5-f3808898a776 - Authority:Performing instance discovery: https://login.microsoftonline.com/00bb54b2-2e46-41f0-8d7d-be73e0fbb027
adal-python : 1887e92d-1bf0-40ce-aad5-f3808898a776 - Authority:Performing static instance discovery
adal-python : 1887e92d-1bf0-40ce-aad5-f3808898a776 - Authority:Authority validated via static instance discovery
adal-python : 1887e92d-1bf0-40ce-aad5-f3808898a776 - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : 1887e92d-1bf0-40ce-aad5-f3808898a776 - OAuth2Client:finding with query: {"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : 1887e92d-1bf0-40ce-aad5-f3808898a776 - OAuth2Client:Looking for potential cache entries:
adal-python : 1887e92d-1bf0-40ce-aad5-f3808898a776 - OAuth2Client:{"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : 1887e92d-1bf0-40ce-aad5-f3808898a776 - OAuth2Client:Found 3 potential entries.
adal-python : 1887e92d-1bf0-40ce-aad5-f3808898a776 - OAuth2Client:Resource specific token found.
adal-python : 1887e92d-1bf0-40ce-aad5-f3808898a776 - OAuth2Client:Returning token from cache lookup, AccessTokenId: b'xxxxx', RefreshTokenId: b'xxxxx'
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Compute/locations/westeurope/operations/c44eaa36-9566-49f1-90f1-f1e95c9df87f?api-version=2017-12-01 HTTP/1.1" 200 None
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/providers/Microsoft.Compute/locations/westeurope/operations/c44eaa36-9566-49f1-90f1-f1e95c9df87f?api-version=2017-12-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger :     'User-Agent': 'python/3.6.4 (Darwin-16.7.0-x86_64-i386-64bit) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 computemanagementclient/3.1.0rc2 Azure-SDK-For-Python AZURECLI/2.0.23'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Authorization': '*****'
msrest.http_logger :     'x-ms-client-request-id': 'e8301262-f516-11e7-9ace-a45e60c0aaf3'
msrest.http_logger :     'CommandName': 'image create'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Transfer-Encoding': 'chunked'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Content-Encoding': 'gzip'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Vary': 'Accept-Encoding'
msrest.http_logger :     'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/GetOperation3Min;11994,Microsoft.Compute/GetOperation30Min;23930'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'x-ms-served-by': '8cc491b3-c524-4526-a3ad-3c75fcdc0a3c_131542262855793710'
msrest.http_logger :     'x-ms-request-id': '2bf7bf4d-cac0-4e74-8d86-20aa3fed82d6'
msrest.http_logger :     'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-reads': '14938'
msrest.http_logger :     'x-ms-correlation-request-id': 'c9d7db95-e1da-4750-8938-59d64be859c2'
msrest.http_logger :     'x-ms-routing-request-id': 'WESTEUROPE:20180109T082752Z:c9d7db95-e1da-4750-8938-59d64be859c2'
msrest.http_logger :     'Date': 'Tue, 09 Jan 2018 08:27:51 GMT'
msrest.http_logger : Response content:
msrest.http_logger : b'{\r\n  "startTime": "2018-01-09T08:27:21.6975499+00:00",\r\n  "endTime": "2018-01-09T08:27:21.7131594+00:00",\r\n  "status": "Succeeded",\r\n  "name": "c44eaa36-9566-49f1-90f1-f1e95c9df87f"\r\n}'
adal-python : c8bdac96-5605-4f57-8151-0299399c4e63 - Authority:Performing instance discovery: https://login.microsoftonline.com/00bb54b2-2e46-41f0-8d7d-be73e0fbb027
adal-python : c8bdac96-5605-4f57-8151-0299399c4e63 - Authority:Performing static instance discovery
adal-python : c8bdac96-5605-4f57-8151-0299399c4e63 - Authority:Authority validated via static instance discovery
adal-python : c8bdac96-5605-4f57-8151-0299399c4e63 - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : c8bdac96-5605-4f57-8151-0299399c4e63 - OAuth2Client:finding with query: {"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : c8bdac96-5605-4f57-8151-0299399c4e63 - OAuth2Client:Looking for potential cache entries:
adal-python : c8bdac96-5605-4f57-8151-0299399c4e63 - OAuth2Client:{"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : c8bdac96-5605-4f57-8151-0299399c4e63 - OAuth2Client:Found 3 potential entries.
adal-python : c8bdac96-5605-4f57-8151-0299399c4e63 - OAuth2Client:Resource specific token found.
adal-python : c8bdac96-5605-4f57-8151-0299399c4e63 - OAuth2Client:Returning token from cache lookup, AccessTokenId: b'xxxxx', RefreshTokenId: b'xxxxx'
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test?api-version=2017-12-01 HTTP/1.1" 200 None
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test?api-version=2017-12-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger :     'User-Agent': 'python/3.6.4 (Darwin-16.7.0-x86_64-i386-64bit) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 computemanagementclient/3.1.0rc2 Azure-SDK-For-Python AZURECLI/2.0.23'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Authorization': '*****'
msrest.http_logger :     'x-ms-client-request-id': 'e8301262-f516-11e7-9ace-a45e60c0aaf3'
msrest.http_logger :     'CommandName': 'image create'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Transfer-Encoding': 'chunked'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Content-Encoding': 'gzip'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Vary': 'Accept-Encoding'
msrest.http_logger :     'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/GetImages3Min;343,Microsoft.Compute/GetImages30Min;1685'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'x-ms-served-by': '8cc491b3-c524-4526-a3ad-3c75fcdc0a3c_131542262855793710'
msrest.http_logger :     'x-ms-request-id': '064ee3d9-96a9-443c-bfa7-9eb49198c212'
msrest.http_logger :     'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-reads': '14988'
msrest.http_logger :     'x-ms-correlation-request-id': '69d7d112-19b6-4435-bc99-f31701851357'
msrest.http_logger :     'x-ms-routing-request-id': 'WESTEUROPE:20180109T082753Z:69d7d112-19b6-4435-bc99-f31701851357'
msrest.http_logger :     'Date': 'Tue, 09 Jan 2018 08:27:53 GMT'
msrest.http_logger : Response content:
msrest.http_logger : b'{\r\n  "properties": {\r\n    "sourceVirtualMachine": {\r\n      "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test"\r\n    },\r\n    "storageProfile": {\r\n      "osDisk": {\r\n        "osType": "Linux",\r\n        "osState": "Generalized",\r\n        "diskSizeGB": 30,\r\n        "managedDisk": {\r\n          "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/disks/test_OsDisk_1_c20b4c826d9f49a6b74536bb0394fe6b"\r\n        },\r\n        "caching": "ReadWrite",\r\n        "storageAccountType": "Standard_LRS"\r\n      },\r\n      "dataDisks": []\r\n    },\r\n    "provisioningState": "Succeeded"\r\n  },\r\n  "type": "Microsoft.Compute/images",\r\n  "location": "westeurope",\r\n  "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test",\r\n  "name": "test"\r\n}'
Application event 'Application.TransformResults' with event data {'event_data': {'result': {'additionalProperties': {}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test', 'name': 'test', 'type': 'Microsoft.Compute/images', 'location': 'westeurope', 'tags': None, 'sourceVirtualMachine': {'additionalProperties': {}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test'}, 'storageProfile': {'addition [...]
Application event 'Application.FilterResults' with event data {'event_data': {'result': {'additionalProperties': {}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test', 'name': 'test', 'type': 'Microsoft.Compute/images', 'location': 'westeurope', 'tags': None, 'sourceVirtualMachine': {'additionalProperties': {}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test', 'resourceGroup': 'my-resource-group [...]
{
  "additionalProperties": {},
  "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test",
  "location": "westeurope",
  "name": "test",
  "provisioningState": "Succeeded",
  "resourceGroup": "my-resource-group",
  "sourceVirtualMachine": {
    "additionalProperties": {},
    "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test",
    "resourceGroup": "my-resource-group"
  },
  "storageProfile": {
    "additionalProperties": {},
    "dataDisks": [],
    "osDisk": {
      "additionalProperties": {},
      "blobUri": null,
      "caching": "ReadWrite",
      "diskSizeGb": 30,
      "managedDisk": {
        "additionalProperties": {},
        "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/disks/test_OsDisk_1_c20b4c826d9f49a6b74536bb0394fe6b",
        "resourceGroup": "my-resource-group"
      },
      "osState": "Generalized",
      "osType": "Linux",
      "snapshot": null,
      "storageAccountType": "Standard_LRS"
    }
  },
  "tags": null,
  "type": "Microsoft.Compute/images"
}

This is the output of az image show:

~ az image show --debug --resource-group my-resource-group --name test
Command arguments ['image', 'show', '--resource-group', 'my-resource-group', '--name', 'test']
Loading all installed modules as module with name 'image' not found.
Installed command modules ['acr', 'acs', 'advisor', 'appservice', 'backup', 'batch', 'batchai', 'billing', 'cdn', 'cloud', 'cognitiveservices', 'configure', 'consumption', 'container', 'cosmosdb', 'dla', 'dls', 'eventgrid', 'extension', 'feedback', 'find', 'interactive', 'iot', 'keyvault', 'lab', 'monitor', 'network', 'profile', 'rdbms', 'redis', 'reservations', 'resource', 'role', 'servicefabric', 'sql', 'storage', 'vm']
Current cloud config:
{'endpoints': {'active_directory': 'https://login.microsoftonline.com',
               'active_directory_data_lake_resource_id': 'https://datalake.azure.net/',
               'active_directory_graph_resource_id': 'https://graph.windows.net/',
               'active_directory_resource_id': 'https://management.core.windows.net/',
               'batch_resource_id': 'https://batch.core.windows.net/',
               'gallery': 'https://gallery.azure.com/',
               'management': 'https://management.core.windows.net/',
               'resource_manager': 'https://management.azure.com/',
               'sql_management': 'https://management.core.windows.net:8443/',
               'vm_image_alias_doc': 'https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json'},
 'is_active': True,
 'name': 'AzureCloud',
 'profile': 'latest',
 'suffixes': {'azure_datalake_analytics_catalog_and_job_endpoint': 'azuredatalakeanalytics.net',
              'azure_datalake_store_file_system_endpoint': 'azuredatalakestore.net',
              'keyvault_dns': '.vault.azure.net',
              'sql_server_hostname': '.database.windows.net',
              'storage_endpoint': 'core.windows.net'}}
Registered application event handler 'CommandTableParams.Loaded' at <function add_id_parameters at 0x109c152f0>
Registered application event handler 'CommandTable.Loaded' at <function add_id_parameters at 0x109c152f0>
Loaded module 'acr' in 0.008 seconds.
Loaded module 'acs' in 0.001 seconds.
Loaded module 'advisor' in 0.001 seconds.
Registered application event handler 'CommandParser.Parsing' at <function deprecate at 0x109c5a8c8>
Loaded module 'appservice' in 0.002 seconds.
Loaded module 'backup' in 0.001 seconds.
Loaded module 'batch' in 0.011 seconds.
Loaded module 'batchai' in 0.002 seconds.
Loaded module 'billing' in 0.003 seconds.
Loaded module 'cdn' in 0.003 seconds.
Loaded module 'cloud' in 0.001 seconds.
Loaded module 'cognitiveservices' in 0.001 seconds.
Loaded module 'configure' in 0.001 seconds.
Loaded module 'consumption' in 0.001 seconds.
Loaded module 'container' in 0.001 seconds.
Registered application event handler 'CommandParser.Parsing' at <function deprecate at 0x109d840d0>
Loaded module 'cosmosdb' in 0.002 seconds.
Loaded module 'dla' in 0.001 seconds.
Loaded module 'dls' in 0.001 seconds.
Loaded module 'eventgrid' in 0.001 seconds.
Loaded module 'extension' in 0.003 seconds.
Loaded module 'feedback' in 0.002 seconds.
Loaded module 'find' in 0.003 seconds.
Loaded module 'interactive' in 0.001 seconds.
Loaded module 'iot' in 0.003 seconds.
Loaded module 'keyvault' in 0.002 seconds.
Loaded module 'lab' in 0.001 seconds.
Loaded module 'monitor' in 0.002 seconds.
Loaded module 'network' in 0.010 seconds.
Loaded module 'profile' in 0.001 seconds.
Loaded module 'rdbms' in 0.002 seconds.
Loaded module 'redis' in 0.001 seconds.
Loaded module 'reservations' in 0.001 seconds.
Loaded module 'resource' in 0.002 seconds.
Loaded module 'role' in 0.001 seconds.
Loaded module 'servicefabric' in 0.001 seconds.
Loaded module 'sql' in 0.004 seconds.
Loaded module 'storage' in 0.014 seconds.
Loaded module 'vm' in 0.190 seconds.
Loaded all modules in 0.286 seconds. (note: there's always an overhead with the first module loaded)
Extensions directory: '/Users/user/.azure/cliextensions'
Application event 'CommandTable.Loaded' with event data {'command_table': {'image show': <azure.cli.core.commands.CliCommand object at 0x10ab4fe10>}}
Application event 'CommandParser.Loaded' with event data {'parser': AzCliCommandParser(prog='az', usage=None, description=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)}
Application event 'CommandTableParams.Loaded' with event data {'command_table': {'image show': <azure.cli.core.commands.CliCommand object at 0x10ab4fe10>}}
Application event 'CommandParser.Parsing' with event data {'argv': ['image', 'show', '--resource-group', 'my-resource-group', '--name', 'test']}
Application event 'CommandParser.Parsed' with event data {'command': 'image show', 'args': Namespace(_command_package='image', _jmespath_query=None, _log_verbosity_debug=False, _log_verbosity_verbose=False, _output_format='json', _parser=AzCliCommandParser(prog='az image show', usage=None, description='Gets an image.', formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True), _validators=[<function add_id_parameters.<locals>.command_loaded_handler.<locals>.required_values_validator at 0x10af11950>], command='ima [...]
Getting management service client client_type=ComputeManagementClient
attempting to read file /Users/user/.azure/accessTokens.json as utf-8-sig
adal-python : c45afa75-c584-4d42-a8b3-7d3a7a2bbb14 - Authority:Performing instance discovery: https://login.microsoftonline.com/00bb54b2-2e46-41f0-8d7d-be73e0fbb027
adal-python : c45afa75-c584-4d42-a8b3-7d3a7a2bbb14 - Authority:Performing static instance discovery
adal-python : c45afa75-c584-4d42-a8b3-7d3a7a2bbb14 - Authority:Authority validated via static instance discovery
adal-python : c45afa75-c584-4d42-a8b3-7d3a7a2bbb14 - TokenRequest:Getting token from cache with refresh if necessary.
adal-python : c45afa75-c584-4d42-a8b3-7d3a7a2bbb14 - OAuth2Client:finding with query: {"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : c45afa75-c584-4d42-a8b3-7d3a7a2bbb14 - OAuth2Client:Looking for potential cache entries:
adal-python : c45afa75-c584-4d42-a8b3-7d3a7a2bbb14 - OAuth2Client:{"_clientId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "userId": "user@gmail.com"}
adal-python : c45afa75-c584-4d42-a8b3-7d3a7a2bbb14 - OAuth2Client:Found 3 potential entries.
adal-python : c45afa75-c584-4d42-a8b3-7d3a7a2bbb14 - OAuth2Client:Resource specific token found.
adal-python : c45afa75-c584-4d42-a8b3-7d3a7a2bbb14 - OAuth2Client:Returning token from cache lookup, AccessTokenId: b'xxxxx', RefreshTokenId: b'xxxxx'
msrest.pipeline : Configuring request: timeout=100, verify=True, cert=None
msrest.pipeline : Configuring redirects: allow=True, max=30
msrest.pipeline : Configuring proxies: ''
msrest.pipeline : Evaluate proxies against ENV settings: True
msrest.pipeline : Configuring retry: max_retries=4, backoff_factor=0.8, max_backoff=90
urllib3.connectionpool : Starting new HTTPS connection (1): management.azure.com
urllib3.connectionpool : https://management.azure.com:443 "GET /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test?api-version=2017-12-01 HTTP/1.1" 200 None
msrest.http_logger : Request URL: 'https://management.azure.com/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test?api-version=2017-12-01'
msrest.http_logger : Request method: 'GET'
msrest.http_logger : Request headers:
msrest.http_logger :     'User-Agent': 'python/3.6.4 (Darwin-16.7.0-x86_64-i386-64bit) requests/2.18.4 msrest/0.4.22 msrest_azure/0.4.19 computemanagementclient/3.1.0rc2 Azure-SDK-For-Python AZURECLI/2.0.23'
msrest.http_logger :     'Accept-Encoding': 'gzip, deflate'
msrest.http_logger :     'Accept': 'application/json'
msrest.http_logger :     'Connection': 'keep-alive'
msrest.http_logger :     'Authorization': '*****'
msrest.http_logger :     'x-ms-client-request-id': '0cf2bd7a-f517-11e7-811e-a45e60c0aaf3'
msrest.http_logger :     'CommandName': 'image show'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'accept-language': 'en-US'
msrest.http_logger : Request body:
msrest.http_logger : None
msrest.http_logger : Response status: 200
msrest.http_logger : Response headers:
msrest.http_logger :     'Cache-Control': 'no-cache'
msrest.http_logger :     'Pragma': 'no-cache'
msrest.http_logger :     'Transfer-Encoding': 'chunked'
msrest.http_logger :     'Content-Type': 'application/json; charset=utf-8'
msrest.http_logger :     'Content-Encoding': 'gzip'
msrest.http_logger :     'Expires': '-1'
msrest.http_logger :     'Vary': 'Accept-Encoding'
msrest.http_logger :     'x-ms-ratelimit-remaining-resource': 'Microsoft.Compute/GetImages3Min;342,Microsoft.Compute/GetImages30Min;1681'
msrest.http_logger :     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
msrest.http_logger :     'x-ms-served-by': '8cc491b3-c524-4526-a3ad-3c75fcdc0a3c_131542262855793710'
msrest.http_logger :     'x-ms-request-id': '2b6a918a-6092-46ed-ae92-f7266f5735e6'
msrest.http_logger :     'Server': 'Microsoft-HTTPAPI/2.0, Microsoft-HTTPAPI/2.0'
msrest.http_logger :     'x-ms-ratelimit-remaining-subscription-reads': '14979'
msrest.http_logger :     'x-ms-correlation-request-id': 'e068eff7-91af-45e9-a112-9130b1b45407'
msrest.http_logger :     'x-ms-routing-request-id': 'WESTEUROPE:20180109T082821Z:e068eff7-91af-45e9-a112-9130b1b45407'
msrest.http_logger :     'Date': 'Tue, 09 Jan 2018 08:28:21 GMT'
msrest.http_logger : Response content:
msrest.http_logger : b'{\r\n  "properties": {\r\n    "sourceVirtualMachine": {\r\n      "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test"\r\n    },\r\n    "storageProfile": {\r\n      "osDisk": {\r\n        "osType": "Linux",\r\n        "osState": "Generalized",\r\n        "diskSizeGB": 30,\r\n        "managedDisk": {\r\n          "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/disks/test_OsDisk_1_c20b4c826d9f49a6b74536bb0394fe6b"\r\n        },\r\n        "caching": "ReadWrite",\r\n        "storageAccountType": "Standard_LRS"\r\n      },\r\n      "dataDisks": []\r\n    },\r\n    "provisioningState": "Succeeded"\r\n  },\r\n  "type": "Microsoft.Compute/images",\r\n  "location": "westeurope",\r\n  "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test",\r\n  "name": "test"\r\n}'
Application event 'Application.TransformResults' with event data {'event_data': {'result': {'additionalProperties': {}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test', 'name': 'test', 'type': 'Microsoft.Compute/images', 'location': 'westeurope', 'tags': None, 'sourceVirtualMachine': {'additionalProperties': {}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test'}, 'storageProfile': {'addition [...]
Application event 'Application.FilterResults' with event data {'event_data': {'result': {'additionalProperties': {}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test', 'name': 'test', 'type': 'Microsoft.Compute/images', 'location': 'westeurope', 'tags': None, 'sourceVirtualMachine': {'additionalProperties': {}, 'id': '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test', 'resourceGroup': 'my-resource-group [...]
{
  "additionalProperties": {},
  "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/images/test",
  "location": "westeurope",
  "name": "test",
  "provisioningState": "Succeeded",
  "resourceGroup": "my-resource-group",
  "sourceVirtualMachine": {
    "additionalProperties": {},
    "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/virtualMachines/test",
    "resourceGroup": "my-resource-group"
  },
  "storageProfile": {
    "additionalProperties": {},
    "dataDisks": [],
    "osDisk": {
      "additionalProperties": {},
      "blobUri": null,
      "caching": "ReadWrite",
      "diskSizeGb": 30,
      "managedDisk": {
        "additionalProperties": {},
        "id": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/my-resource-group/providers/Microsoft.Compute/disks/test_OsDisk_1_c20b4c826d9f49a6b74536bb0394fe6b",
        "resourceGroup": "my-resource-group"
      },
      "osState": "Generalized",
      "osType": "Linux",
      "snapshot": null,
      "storageAccountType": "Standard_LRS"
    }
  },
  "tags": null,
  "type": "Microsoft.Compute/images"
}
yugangw-msft commented 6 years ago

@shaharmor, thanks for the detail. I am contacting Compute Service team for whether an image captured from a VM can be updated. At the same time, can you delete the image first?

shaharmor commented 6 years ago

@yugangw-msft Not sure what you're asking. I can delete the image before creating the new one and it will work, but I'd prefer to have:

  1. If I don't explicitly use something like --overwrite, I'd expect the command az image create to return an error if the image exists
  2. If I use --overwrite, to make it actually overwrite :)
yugangw-msft commented 6 years ago

I have asked service team for the expected behavior. There is a service end bug here. In short, no property of image (except tags) can be updated. This effectively rules out the option of supporting --overwrite. The current implementations looks like:

  1. On update of an image, service will fail if any property has changed. Updates to tags are allowed though.
  2. If nothing has changed, service accepts the operation and don’t do anything.

The point 2 was to tackle the cases where service somehow get the same request multiple times because of communication errors, but it doesn’t mesh well with your scenario (where the source VM has changed).

The potential fix would either error out or support re-capturing. I will post update in future

huangpf commented 6 years ago

LSTM

shaharmor commented 5 years ago

Any update on this?

yonzhan commented 4 years ago

issue triaged.

gntpet commented 3 years ago

any updated on this?