def _set_instance_ip(self):
try:<EOL><INDENT>ip_address = self.network.public_ip_addresses.get(<EOL>self.running_instance_id, self.public_ip_name<EOL>).ip_address<EOL><DEDENT>except Exception:<EOL><INDENT>try:<EOL><INDENT>ip_address = self.network.network_interfaces.get(<EOL>self.running_instance_id, self.nic_name<EOL>).ip_configurations[<NUM_LIT:0>].private_ip_address<EOL><DEDENT>except Exception as error:<EOL><INDENT>raise AzureCloudException(<EOL>'<STR_LIT>'.format(<EOL>error<EOL>)<EOL>)<EOL><DEDENT><DEDENT>self.instance_ip = ip_address<EOL>
Get the IP address based on instance ID.

If public IP address not found attempt to get private IP.