diff --git a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py index 180982a3ac0..51445c09c65 100644 --- a/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py +++ b/lib/ansible/modules/cloud/azure/azure_rm_virtualmachine.py @@ -1127,6 +1127,8 @@ class AzureRMVirtualMachine(AzureRMModuleBase): disk_size_gb=vm_dict['properties']['storageProfile']['osDisk']['diskSizeGB'] ), image_reference=self.compute_models.ImageReference( + id=vm_dict['properties']['storageProfile']['imageReference']['id'], + ) if 'id' in vm_dict['properties']['storageProfile']['imageReference'].keys() else self.compute_models.ImageReference( publisher=vm_dict['properties']['storageProfile']['imageReference']['publisher'], offer=vm_dict['properties']['storageProfile']['imageReference']['offer'], sku=vm_dict['properties']['storageProfile']['imageReference']['sku'],