drivers/azure/azureutil/azureutil.go
func (a AzureClient) GetPublicIPAddress(resourceGroup, name string, useFqdn bool) (string, error) {
	f := logutil.Fields{"name": name}
	log.Debug("Querying public IP address.", f)
	ip, err := a.publicIPAddressClient().Get(resourceGroup, name, "")
	if err != nil {
		return "", err
	}
	if ip.Properties == nil {
		log.Debug("publicIP.Properties is nil. Could not determine IP address", f)
		return "", nil
	}

	if useFqdn { // return FQDN value on public IP
		log.Debug("Will attempt to return FQDN.", f)
		if ip.Properties.DNSSettings == nil || ip.Properties.DNSSettings.Fqdn == nil {
			return "", errors.New("FQDN not found on public IP address")
		}
		return to.String(ip.Properties.DNSSettings.Fqdn), nil
	}
	return to.String(ip.Properties.IPAddress), nil
}
func (a AzureClient) GetPublicIPAddress(resourceGroup, name string, useFqdn bool) (string, error) {
	f := logutil.Fields{"name": name}
	log.Debug("Querying public IP address.", f)
	ip, err := a.publicIPAddressClient().Get(resourceGroup, name, "")
	if err != nil {
		return "", err
	}
	if ip.Properties == nil {
		log.Debug("publicIP.Properties is nil. Could not determine IP address", f)
		return "", nil
	}

	if useFqdn { // return FQDN value on public IP
		log.Debug("Will attempt to return FQDN.", f)
		if ip.Properties.DNSSettings == nil || ip.Properties.DNSSettings.Fqdn == nil {
			return "", errors.New("FQDN not found on public IP address")
		}
		return to.String(ip.Properties.DNSSettings.Fqdn), nil
	}
	return to.String(ip.Properties.IPAddress), nil
}
func ( a AzureClient ) GetPublicIPAddress ( resourceGroup , name string , useFqdn bool ) ( string , error ) { f := logutil . Fields { " " : name } log . Debug ( " " , f ) ip , err := a . publicIPAddressClient ( ) . Get ( resourceGroup , name , " " ) if err != nil { return " " , err } if ip . Properties == nil { log . Debug ( " " , f ) return " " , nil } if useFqdn { // return FQDN value on public IP log . Debug ( " " , f ) if ip . Properties . DNSSettings == nil || ip . Properties . DNSSettings . Fqdn == nil { return " " , errors . New ( " " ) } return to . String ( ip . Properties . DNSSettings . Fqdn ) , nil } return to . String ( ip . Properties . IPAddress ) , nil }
// GetPublicIPAddress attempts to get public IP address from the Public IP
// resource. If IP address is not allocated yet, returns empty string. If
// useFqdn is set to true, the a FQDN hostname will be returned.
GetPublicIPAddress attempts to get public IP address from the Public IP resource . If IP address is not allocated yet returns empty string . If useFqdn is set to true the a FQDN hostname will be returned .