{"record":{"id":"460175f76ae829c0","repo":"databendlabs/databend","slug":"endpoint-url-is-required-for-storage-azblob","errorCode":null,"errorMessage":"endpoint_url is required for storage azblob","messagePattern":"endpoint_url is required for storage azblob","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/query/sql/src/planner/binder/location.rs","lineNumber":68,"sourceCode":"use opendal::raw::normalize_path;\nuse opendal::raw::normalize_root;\n\n/// secure_omission will fix omitted endpoint url schemes into 'https://'\n#[inline]\nfn secure_omission(endpoint: String) -> String {\n    // checking with starts_with() should be enough here\n    if !endpoint.starts_with(\"https://\") && !endpoint.starts_with(\"http://\") {\n        format!(\"https://{}\", endpoint)\n    } else {\n        endpoint\n    }\n}\n\nfn parse_azure_params(l: &mut UriLocation, root: String) -> Result<StorageParams> {\n    let endpoint = l.connection.get(\"endpoint_url\").cloned().ok_or_else(|| {\n        Error::new(\n            ErrorKind::InvalidInput,\n            anyhow!(\"endpoint_url is required for storage azblob\"),\n        )\n    })?;\n    let endpoint = secure_omission(endpoint);\n    let sp = StorageParams::Azblob(StorageAzblobConfig {\n        endpoint_url: endpoint,\n        container: l.name.to_string(),\n        account_name: l\n            .connection\n            .get(\"account_name\")\n            .cloned()\n            .unwrap_or_default(),\n        account_key: l.connection.get(\"account_key\").cloned().unwrap_or_default(),\n        root,\n        network_config: None,\n    });\n\n    l.connection\n        .check()","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/databendlabs/databend/blob/288d84d76e20a2f8f7173bda9691eb6ece301aa9/src/query/sql/src/planner/binder/location.rs#L50-L86","documentation":"parse_azure_params builds StorageParams::Azblob from a URI location's CONNECTION options and requires an `endpoint_url` entry. When the connection string lacks it, it fails with ErrorKind::InvalidInput and \"endpoint_url is required for storage azblob\". Unlike S3, the azblob storage config here does not default the endpoint from the URL host.","triggerScenarios":"Issuing a location/COPY/STAGE statement with STORAGE_CONNECTION_STRING style options like 'connection = { ... }' targeting azblob without `endpoint_url`, e.g. CREATE STAGE ... URL='azblob://container/path' CONNECTION=(CONTAINER='x') with no ENDPOINT_URL.","commonSituations":"Copy-pasting S3-style stage definitions to Azure; forgetting that Azure Blob requires the account-specific https endpoint; omitting the endpoint in connection options while only setting account/container.","solutions":["Add ENDPOINT_URL to the CONNECTION options: CONNECTION=(ENDPOINT_URL='https://<account>.blob.core.windows.net' ...)","Include the storage account name and container consistently with the endpoint","Use an azure storage connection-string based config if supported instead of raw azblob params","Check documentation for azblob stage requirements and compare with a working example"],"exampleFix":"-- before\nCREATE STAGE s URL='azblob://mycontainer/data/' CONNECTION=(ACCOUNT_NAME='acct');\n-- after\nCREATE STAGE s URL='azblob://mycontainer/data/'\n  CONNECTION=(ENDPOINT_URL='https://acct.blob.core.windows.net' ACCOUNT_NAME='acct');","handlingStrategy":"validation","validationCode":"// check connection options before issuing the statement\nif !conn.contains_key(\"ENDPOINT_URL\") {\n    return Err(anyhow!(\"azblob stage requires ENDPOINT_URL in CONNECTION\"));\n}","typeGuard":null,"tryCatchPattern":"match parse_uri_location_resolved(loc) {\n    Err(e) if e.to_string().contains(\"endpoint_url is required\") => {\n        eprintln!(\"Add CONNECTION=(ENDPOINT_URL='https://<account>.blob.core.windows.net' ...)\");\n    }\n    other => other?,\n}","preventionTips":["Always include ENDPOINT_URL for azblob stages","Keep a template stage DDL per cloud provider","Validate CONNECTION options against the docs for the target storage type"],"tags":["azure","storage","configuration","stage"],"backgroundTag":"missing-required-config-field","analyzedSha":"288d84d76e20a2f8f7173bda9691eb6ece301aa9","analyzedAt":"2026-09-11T11:29:36.208Z","contentChangedAt":"2026-09-11T11:29:36.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}