azurecli

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const InstallURL = "https://learn.microsoft.com/en-us/cli/azure/"

Variables

View Source
var ErrNotInstalled = fmt.Errorf("az CLI not found in PATH — install it from %s", InstallURL)

ErrNotInstalled is returned when the `az` binary cannot be found on PATH.

Functions

func CheckInstalled

func CheckInstalled() error

CheckInstalled returns ErrNotInstalled if the `az` binary is not on PATH. Callers should use this before performing setup work to avoid leaving partial state.

func Exec

func Exec(ctx context.Context, extraEnv []string, stdin io.Reader, stdout, stderr io.Writer, args ...string) error

Exec runs `az <args...>`. extraEnv is appended to the inherited process environment (later entries win), letting callers inject AZURE_CONFIG_DIR, proxy, and CA settings without mutating the user's global Azure CLI configuration.

func Run

func Run(ctx context.Context, extraEnv []string, args ...string) (stdout, stderr string, err error)

Run executes `az <args...>` with extraEnv and returns the captured stdout, stderr, and any error. On non-zero exit, the error wraps stderr to aid debugging.

Types

This section is empty.

Jump to

Keyboard shortcuts

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