Documentation
¶
Index ¶
- Constants
- func HasAuthorizationFailedError(err error) bool
- func HasLinkedAuthorizationFailedError(err error) bool
- func Is4xxError(err error) bool
- func IsClientSecretKeysExpired(err error) bool
- func IsDeploymentActiveError(err error) bool
- func IsDeploymentMissingPermissionsError(err error) bool
- func IsInvalidSecretError(err error) bool
- func IsManagedResourceGroupError(err error, managedRGName string) bool
- func IsNotFoundError(err error) bool
- func IsRetryableError(err error) bool
- func IsStatusConflictError(err error) bool
- func IsUnauthorizedClientError(err error) bool
- func ResourceGroupNotFound(err error) bool
- func ResourceGroupsFromError(err error) []string
- type VMProfileType
Constants ¶
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 ¶
HasAuthorizationFailedError returns true it the error is, or contains, an AuthorizationFailed error
func HasLinkedAuthorizationFailedError ¶
HasLinkedAuthorizationFailedError returns true it the error is, or contains, a LinkedAuthorizationFailed error
func Is4xxError ¶
func IsClientSecretKeysExpired ¶
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 ¶
IsDeploymentActiveError returns true it the error is a DeploymentActive error.
func IsDeploymentMissingPermissionsError ¶
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 ¶
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 IsNotFoundError ¶
func IsRetryableError ¶
IsRetryableError returns true if the error is a transient/retryable error such as 429 Too Many Requests or contains RetryableError code
func IsStatusConflictError ¶
func IsUnauthorizedClientError ¶
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 ¶
ResourceGroupNotFound returns true if the error is an ResourceGroupNotFound error
func ResourceGroupsFromError ¶
ResourceGroupsFromError attempts to extract the Azure resource group names from error. It checks (in order):
- The HTTP request URL from the response attached to the error
- 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