azureerrors

package
v0.0.0-...-b015d5c Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const (
	CODE_AUTHFAILED       = "AuthorizationFailed"
	CODE_DEPLOYACTIVE     = "DeploymentActive"
	CODE_DEPLOYFAILED     = "DeploymentFailed"
	CODE_FORBIDDEN        = "Forbidden"
	CODE_INVALIDTEMPL     = "InvalidTemplateDeployment"
	CODE_LINKEDAUTHFAILED = "LinkedAuthorizationFailed"
	CODE_RGNOTFOUND       = "ResourceGroupNotFound"

	// VM SKU availability error codes
	CODE_INVALIDPARAM          = "InvalidParameter"
	CODE_NOTAVAILABLEFORSUBSCR = "NotAvailableForSubscription"
	CODE_QUOTAEXCEEDED         = "QuotaExceeded"
	CODE_SKUNOTAVAILABLE       = "SkuNotAvailable"
)

Variables

This section is empty.

Functions

func HasAuthorizationFailedError

func HasAuthorizationFailedError(err error) bool

HasAuthorizationFailedError returns true it the error is, or contains, an AuthorizationFailed error

func HasLinkedAuthorizationFailedError

func HasLinkedAuthorizationFailedError(err error) bool

HasLinkedAuthorizationFailedError returns true it the error is, or contains, a LinkedAuthorizationFailed error

func Is4xxError

func Is4xxError(err error) bool

func IsClientSecretKeysExpired

func IsClientSecretKeysExpired(err error) bool

Returns true when the error is due to expired application client/secret keys. See https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes#aadsts-error-codes

func IsDeploymentActiveError

func IsDeploymentActiveError(err error) bool

IsDeploymentActiveError returns true it the error is a DeploymentActive error.

func IsDeploymentMissingPermissionsError

func IsDeploymentMissingPermissionsError(err error) bool

IsDeploymentMissingPermissionsError returns true if the error indicates that ARM rejected a template deployment pre-flight due to missing role assignments. This can be an indicator of role assignment propagation delay.

func IsInvalidSecretError

func IsInvalidSecretError(err error) bool

IsInvalidSecretError returns if errors is InvalidCredentials error Example: (adal.tokenRefreshError) adal: Refresh request failed. Status Code = '401'. Response body: {"error":"invalid_client","error_description":"AADSTS7000215: Invalid client secret is provided.

func IsManagedResourceGroupError

func IsManagedResourceGroupError(err error, managedRGName string) bool

func IsNotFoundError

func IsNotFoundError(err error) bool

func IsRetryableError

func IsRetryableError(err error) bool

IsRetryableError returns true if the error is a transient/retryable error such as 429 Too Many Requests or contains RetryableError code

func IsStatusConflictError

func IsStatusConflictError(err error) bool

func IsUnauthorizedClientError

func IsUnauthorizedClientError(err error) bool

IsUnauthorizedClientError return if errors is UnauthorizedClient Example: {"error": "unauthorized_client", "error_description": "AADSTS700016: Application with identifier 'xxx' was not found in the directory 'xxx'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant. ...", "error_codes": [700016]}`. This can be an indicator of AAD propagation delay.

func ResourceGroupNotFound

func ResourceGroupNotFound(err error) bool

ResourceGroupNotFound returns true if the error is an ResourceGroupNotFound error

func ResourceGroupsFromError

func ResourceGroupsFromError(err error) []string

ResourceGroupsFromError attempts to extract the Azure resource group names from error. It checks (in order):

  1. The HTTP request URL from the response attached to the error
  2. All resource IDs in the error message text

Types

type VMProfileType

type VMProfileType int

VMProfileType identifies which VM profile (master or worker) is affected by an error.

const (
	VMProfileUnknown VMProfileType = iota
	VMProfileMaster
	VMProfileWorker
)

func IsVMSKUError

func IsVMSKUError(err error) (bool, VMProfileType)

IsVMSKUError checks if the error is a VM SKU availability error and returns which profile (master/worker) is affected. Azure Resource Manager error codes: https://learn.microsoft.com/en-us/azure/azure-resource-manager/troubleshooting/error-sku-not-available

Jump to

Keyboard shortcuts

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