code: func (as *availabilitySet) GetIPByNodeName(name string) (string, string, error) {
  	nic, err := as.GetPrimaryInterface(name)
  	if err != nil {
  		return "", "", err
  	}
  
  	ipConfig, err := getPrimaryIPConfig(nic)
  	if err != nil {
  		klog.Errorf("as.GetIPByNodeName(%s) failed: getPrimaryIPConfig(%v), err=%v", name, nic, err)
  		return "", "", err
  	}
  
  	privateIP := *ipConfig.PrivateIPAddress
  	publicIP := ""
  	if ipConfig.PublicIPAddress != nil && ipConfig.PublicIPAddress.ID != nil {
  		pipID := *ipConfig.PublicIPAddress.ID
  		pipName, err := getLastSegment(pipID)
  		if err != nil {
  			return "", "", fmt.Errorf("failed to publicIP name for node %q with pipID %q", name, pipID)
  		}
  		pip, existsPip, err := as.getPublicIPAddress(as.ResourceGroup, pipName)
  		if err != nil {
  			return "", "", err
  		}
  		if existsPip {
  			publicIP = *pip.IPAddress
  		}
  	}
  
  	return privateIP, publicIP, nil
  }
docs: // GetIPByNodeName gets machine private IP and public IP by node name.