def get_all_ips(self, instance, network_client):
        """ Returns the private and public ip addresses of an Azure instances
        """
        output = []
        for interface in instance.network_profile.network_interfaces:
            if_name = " ".join(interface.id.split('/')[-1:])
            rg = "".join(interface.id.split('/')[4])

            try:
                thing = self.ipconfig_cache.get(if_name)
                if thing is None:
                    thing = network_client.network_interfaces.get(
                        rg, if_name).ip_configurations
                    self.ipconfig_cache[if_name] = thing
                for x in thing:
                    private_ip = x.private_ip_address
                    public_ip = None
                    """print('\nifdata: ',rg,if_name,x.private_ip_address,x.public_ip_address)"""
                    """ Have to extract public IP from public IP class structure...if present """
                    if x.public_ip_address is not None:
                        public_ip_id = x.public_ip_address.id
                        public_ip_name = " ".join(public_ip_id.split('/')[-1:])
                        try:
                            public_ip_return = network_client.public_ip_addresses.get(
                                rg, public_ip_name)
                            public_ip = public_ip_return.ip_address
                        except:
                            """ Ignore the exception.  return no additional values """

                    temp_pair = (private_ip, public_ip)
                    output.append(temp_pair)

            except Exception:
                """ Ignore the exception.  return no additional values """

        return output
 Returns the private and public ip addresses of an Azure instances
        
powerfulseal/clouddrivers/azure_driver.py