{"record":{"id":"14dcaa7d2a7f90d3","repo":"kubernetes/kops","slug":"creating-resource-group-client-w","errorCode":null,"errorMessage":"creating resource group client: %w","messagePattern":"creating resource group client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/resourcegroup.go","lineNumber":72,"sourceCode":"\t}\n\treturn l, nil\n}\n\nfunc (c *resourceGroupsClientImpl) Delete(ctx context.Context, name string) error {\n\tfuture, err := c.c.BeginDelete(ctx, name, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"deleting resource group: %w\", err)\n\t}\n\tif _, err = future.PollUntilDone(ctx, nil); err != nil {\n\t\treturn fmt.Errorf(\"waiting for resource group deletion completion: %w\", err)\n\t}\n\treturn nil\n}\n\nfunc newResourceGroupsClientImpl(subscriptionID string, cred *azidentity.DefaultAzureCredential) (*resourceGroupsClientImpl, error) {\n\tc, err := resources.NewResourceGroupsClient(subscriptionID, cred, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating resource group client: %w\", err)\n\t}\n\treturn &resourceGroupsClientImpl{\n\t\tc: c,\n\t}, nil\n}\n","sourceCodeStart":54,"sourceCodeEnd":78,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/resourcegroup.go#L54-L78","documentation":"Wraps failure of resources.NewResourceGroupsClient, the constructor for the ARM resource groups client. As with the other Azure client constructors, failure means the SDK could not build a client pipeline for the given subscription ID and credential/options.","triggerScenarios":"newResourceGroupsClientImpl(subscriptionID, cred) called (from newAzureCloud) with an empty subscription ID or invalid credential/options.","commonSituations":"Missing or empty subscription ID in kOps Azure cloud configuration; constructing the cloud before credentials are resolved; SDK version upgrade changing the constructor signature/behavior.","solutions":["Pass a valid, non-empty subscription ID (check AZURE_SUBSCRIPTION_ID / cluster spec)","Confirm cred (DefaultAzureCredential) is non-nil and was built successfully","After upgrading azure-sdk-for-go modules, update the constructor call to the new API","Set AZURE_TENANT_ID/CLIENT_ID/CLIENT_SECRET explicitly if environment auth is expected"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if strings.TrimSpace(subscriptionID) == \"\" {\n  return errors.New(\"azure: resource groups client requires a non-empty subscription ID\")\n}\nif cred == nil {\n  return errors.New(\"azure: credential must be constructed before creating clients\")\n}","typeGuard":"func isValidSubscriptionID(id string) bool {\n  re := regexp.MustCompile(`^[0-9a-fA-F-]{36}$`)\n  return re.MatchString(id)\n}","tryCatchPattern":"rgc, err := newResourceGroupsClientImpl(subID, cred)\nif err != nil {\n  return nil, fmt.Errorf(\"cannot build azure cloud (check AZURE_SUBSCRIPTION_ID and credentials): %w\", err)\n}","preventionTips":["Validate subscription ID format before cloud construction","Build and verify credentials first, then construct clients","Keep azure-sdk-for-go modules in sync across all azure client files","Add a preflight 'az account show' check to CI teardown jobs"],"tags":["azure","client-construction","configuration"],"backgroundTag":"azure-client-init-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}