{"record":{"id":"dec495895c422228","repo":"benbjohnson/litestream","slug":"abs-cannot-create-azure-blob-client-with-default","errorCode":null,"errorMessage":"abs: cannot create azure blob client with default credential: %w","messagePattern":"abs: cannot create azure blob client with default credential: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"abs/replica_client.go","lineNumber":198,"sourceCode":"\t\tclient, err = azblob.NewClientWithSharedKeyCredential(endpoint, credential, clientOptions)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"abs: cannot create azure blob client with shared key: %w\", err)\n\t\t}\n\t} else {\n\t\t// Use default credential chain (similar to AWS SDK default credential chain)\n\t\t// This includes:\n\t\t// - Environment variables (AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID)\n\t\t// - Managed Identity (for Azure VMs, App Service, etc.)\n\t\t// - Azure CLI credentials\n\t\t// - Visual Studio Code credentials\n\t\tslog.Debug(\"using default credential chain (managed identity, Azure CLI, environment variables, etc.)\")\n\t\tcredential, err := azidentity.NewDefaultAzureCredential(nil)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"abs: cannot create default azure credential: %w\", err)\n\t\t}\n\t\tclient, err = azblob.NewClient(endpoint, credential, clientOptions)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"abs: cannot create azure blob client with default credential: %w\", err)\n\t\t}\n\t}\n\n\tc.client = client\n\treturn nil\n}\n\n// LTXFiles returns an iterator over all available LTX files.\n// Azure always uses accurate timestamps from metadata since they're included in LIST operations at zero cost.\n// The useMetadata parameter is ignored.\nfunc (c *ReplicaClient) LTXFiles(ctx context.Context, level int, seek ltx.TXID, useMetadata bool) (ltx.FileIterator, error) {\n\tif err := c.Init(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\treturn newLTXFileIterator(ctx, c, level, seek), nil\n}\n\n// WriteLTXFile writes an LTX file to remote storage.","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/benbjohnson/litestream/blob/4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3/abs/replica_client.go#L180-L216","documentation":"The Azure Blob Service client could not be constructed from the default credential chain in abs.ReplicaClient.Init. The credential itself resolved, but building the azblob client with it failed, typically because the endpoint/account URL is malformed or unreachable DNS-wise during client construction.","triggerScenarios":"Thrown at abs/replica_client.go:198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the endpoint URL (abs://account.blob.core.windows.net or custom endpoint) is well-formed","Confirm the account name is correct and the storage account exists","Check network/DNS access to the endpoint"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4ed7a308f6271ebfd2b0a6e4b70b03011a37e4a3","analyzedAt":"2026-09-06T18:29:25.564Z","contentChangedAt":"2026-09-06T18:29:25.564Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}