{"record":{"id":"b3039f25243f585b","repo":"kubernetes/kops","slug":"error-creating-an-identity-s","errorCode":null,"errorMessage":"error creating an identity: %s","messagePattern":"error creating an identity: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/azure/azure_cloud.go","lineNumber":116,"sourceCode":"\tdefer azureCloudInstancesMutex.Unlock()\n\tazureCloudInstances[subscriptionID+\"::\"+resourceGroupName] = cloud\n}\n\n// NewAzureCloud creates a new AzureCloud, or returns a cached instance for the given subscription and resource group.\nfunc NewAzureCloud(subscriptionID, resourceGroupName, location string, tags map[string]string) (AzureCloud, error) {\n\tazureCloudInstancesMutex.RLock()\n\ti := azureCloudInstances[subscriptionID+\"::\"+resourceGroupName]\n\tazureCloudInstancesMutex.RUnlock()\n\tif i != nil {\n\t\treturn i, nil\n\t}\n\treturn newAzureCloud(subscriptionID, resourceGroupName, location, tags)\n}\n\nfunc newAzureCloud(subscriptionID, resourceGroupName, location string, tags map[string]string) (AzureCloud, error) {\n\tcred, err := azidentity.NewDefaultAzureCredential(nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error creating an identity: %s\", err)\n\t}\n\n\tazureCloudImpl := &azureCloudImplementation{\n\t\tsubscriptionID:    subscriptionID,\n\t\tresourceGroupName: resourceGroupName,\n\t\tlocation:          location,\n\t\ttags:              tags,\n\t}\n\n\tif azureCloudImpl.resourceGroupsClient, err = newResourceGroupsClientImpl(subscriptionID, cred); err != nil {\n\t\treturn nil, err\n\t}\n\tif azureCloudImpl.vnetsClient, err = newVirtualNetworksClientImpl(subscriptionID, cred); err != nil {\n\t\treturn nil, err\n\t}\n\tif azureCloudImpl.subnetsClient, err = newSubnetsClientImpl(subscriptionID, cred); err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/azure/azure_cloud.go#L98-L134","documentation":"azidentity failed to construct a DefaultAzureCredential while newAzureCloud was initializing the cloud interface — no usable credential source (env vars, managed identity, CLI login) was available in the environment.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/azure/azure_cloud.go:116 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set AZURE_CLIENT_ID/AZURE_CLIENT_SECRET/AZURE_TENANT_ID or run 'az login'","If using managed identity, verify it is available on the host","Check the wrapped error for the specific credential chain failure"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}