{"record":{"id":"0383552368cde090","repo":"argoproj/argo-workflows","slug":"unable-to-parse-azure-blob-storage-endpoint-url-s","errorCode":null,"errorMessage":"unable to parse Azure Blob Storage endpoint url %s: %w","messagePattern":"unable to parse Azure Blob Storage endpoint url (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"workflow/artifacts/azure/azure.go","lineNumber":44,"sourceCode":")\n\n// ArtifactDriver is a driver for Azure Blob Storage\ntype ArtifactDriver struct {\n\tAccountKey  string\n\tContainer   string\n\tEndpoint    string\n\tUseSDKCreds bool\n}\n\nvar _ artifactscommon.ArtifactDriver = &ArtifactDriver{}\n\n// newAzureContainerClient creates a new container.Client for interacting with the specified Azure Blob Storage container\n// The container client is created with the default azblob.ClientOptions which does include retry behavior\n// for failed requests.\nfunc (azblobDriver *ArtifactDriver) newAzureContainerClient(ctx context.Context) (*container.Client, error) {\n\tcontainerURL, err := url.Parse(azblobDriver.Endpoint)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to parse Azure Blob Storage endpoint url %s: %w\", azblobDriver.Endpoint, err)\n\t}\n\t// Append the container name to the URL path\n\tif len(containerURL.Path) == 0 || containerURL.Path[len(containerURL.Path)-1] != '/' {\n\t\tcontainerURL.Path += \"/\"\n\t}\n\tcontainerURL.Path += azblobDriver.Container\n\n\tif azblobDriver.UseSDKCreds {\n\t\tcredential, credErr := azidentity.NewDefaultAzureCredential(nil)\n\t\tif credErr != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to create default Azure credential: %w\", credErr)\n\t\t}\n\t\tcontainerClient, clientErr := container.NewClient(containerURL.String(), credential, nil)\n\t\treturn containerClient, clientErr\n\t}\n\tif azblobDriver.AccountKey == \"\" {\n\t\treturn nil, fmt.Errorf(\"accountKey secret is required for Azure Blob Storage if useSDKCreds is false\")\n\t}","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/argoproj/argo-workflows/blob/35bff19146f5a6ada77468c431f2624bd577e373/workflow/artifacts/azure/azure.go#L26-L62","documentation":"newAzureContainerClient parses the configured Azure Blob Storage endpoint with url.Parse before attaching the container name; a malformed endpoint string produces this wrapped error. It is the first failure point for every Azure artifact operation (Load, Save, streams, Delete, ListObjects).","triggerScenarios":"azblobDriver.Endpoint is empty, contains spaces, lacks a scheme (e.g. 'myaccount.blob.core.windows.net' without https://), or is otherwise not a valid URL.","commonSituations":"Missing endpoint in the azure artifact storage config secret; truncated or quoted endpoint value in a k8s secret; using an Azurite/localhost endpoint with a typo.","solutions":["Set endpoint to a full valid URL such as https://<account>.blob.core.windows.net in the artifact storage configuration.","Verify the k8s secret value has no stray quotes, whitespace, or newlines (kubectl get secret ... -o jsonpath and inspect).","Check the error's wrapped cause to see the exact parse failure reported by url.Parse."],"exampleFix":"// before — endpoint in secret\nendpoint: myaccount.blob.core.windows.net\n// after\nendpoint: https://myaccount.blob.core.windows.net","handlingStrategy":"validation","validationCode":"func validateAzureEndpoint(endpoint string) error {\n\tu, err := url.Parse(endpoint)\n\tif err != nil || u.Scheme == \"\" || u.Host == \"\" {\n\t\treturn fmt.Errorf(\"azure endpoint must be a full URL like https://<account>.blob.core.windows.net, got %q\", endpoint)\n\t}\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":"containerClient, err := driver.newAzureContainerClient(ctx)\nif err != nil {\n\tvar urlErr *url.Error\n\tif errors.As(err, &urlErr) { /* fix endpoint URL */ }\n\treturn fmt.Errorf(\"azure artifact download failed: %w\", err)\n}","preventionTips":["Store endpoints as full URLs with https:// scheme in secrets.","kubectl get secret ... -o jsonpath='{.data.endpoint}' | base64 -d to check for stray quotes/newlines.","Validate endpoint format in CI before deploying config changes."],"tags":["azure","configuration","url-parsing"],"backgroundTag":"invalid-endpoint-url","analyzedSha":"35bff19146f5a6ada77468c431f2624bd577e373","analyzedAt":"2026-09-03T19:34:35.908Z","contentChangedAt":"2026-09-03T19:34:35.908Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}