azure

package
v0.0.0-...-a5a9a89 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package azure provides utilities to detect Azure cloud provider.

Index

Constants

This section is empty.

Variables

View Source
var (

	// CloudProviderName contains the inventory name of for EC2
	CloudProviderName = "Azure"
)

declare these as vars not const to ease testing

Functions

func GetClusterName

func GetClusterName(ctx context.Context) (string, error)

func GetHostAliases

func GetHostAliases(ctx context.Context) ([]string, error)

GetHostAliases returns the VM ID from the Azure Metadata api

func GetHostCCRID

func GetHostCCRID(ctx context.Context) (string, error)

GetHostCCRID returns the Canonical Cloud Resource ID for the Azure host

func GetHostname

func GetHostname(ctx context.Context) (string, error)

GetHostname returns hostname based on Azure instance metadata.

func GetInstanceType

func GetInstanceType(ctx context.Context) (string, error)

GetInstanceType returns the instance type as reported by Azure instance metadata.

func GetMetadataAPIVersion

func GetMetadataAPIVersion() string

GetMetadataAPIVersion returns the Azure metadata API version query parameter used by the agent

func GetNTPHosts

func GetNTPHosts(ctx context.Context) []string

GetNTPHosts returns the NTP hosts for Azure if it is detected as the cloud provider, otherwise an empty array. Demo: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/time-sync

func GetPublicIPv4

func GetPublicIPv4(ctx context.Context) (string, error)

GetPublicIPv4 returns the public IPv4 address of the current Azure instance

func GetSubscriptionID

func GetSubscriptionID(ctx context.Context) (string, error)

GetSubscriptionID returns the subscription ID of the current Azure instance

func IsRunningOn

func IsRunningOn(ctx context.Context) bool

IsRunningOn returns true if the agent is running on Azure

func ParseClusterNameFromResourceGroup

func ParseClusterNameFromResourceGroup(rg string) (string, error)

ParseClusterNameFromResouceGroup expects the rg name to have the format (MC|mc)_resource-group_cluster-name_zone

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL