ClickHouse / ClickHouse

ClickHouse® is a real-time analytics DBMS
https://clickhouse.com
Apache License 2.0
36.91k stars 6.82k forks source link

Unable to configure AzureBlobStorage Table Engine with SAS token #67965

Open rokukapsch opened 1 month ago

rokukapsch commented 1 month ago

Describe the unexpected behaviour Unable to configure AzureBlobStorage Table Engine with SAS token.

https://clickhouse.com/docs/en/engines/table-engines/integrations/azureBlobStorage

How to reproduce Clickhouse Version v24.7.2.13-stable

CREATE TABLE default.test ( name String ) ENGINE = AzureBlobStorage('https://.blob.core.windows.net?', 'test', 'test.parquet')

Expected behavior Table is created.

Error message and/or stacktrace Received exception from server (version 24.7.2): Code: 1001. DB::Exception: Received from localhost:9000. DB::Exception: Azure::Core::Credentials::AuthenticationException: GetToken(): error response: 400 Bad Request

{"error":"invalid_request","error_description":"Identity not found"}. (STD_EXCEPTION)

Additional context https://github.com/ClickHouse/ClickHouse/blob/v24.7.2.13-stable/src/Disks/ObjectStorages/AzureBlobStorage/AzureBlobStorageCommon.cpp#L213

Looks like that even if a SAS token is specified, a ManagedIdentityCredential is used for authentication. Maybe another BlobContainerClient constructor without credential needs to be used, like https://azuresdkdocs.blob.core.windows.net/$web/cpp/azure-storage-blobs/12.0.0/class_azure_1_1_storage_1_1_blobs_1_1_blob_container_client.html#ad58f17faab40f56b891b3ba442b8bf8a

kmatt commented 6 days ago

Same issue with ClickHouse local version 24.9.1.2685 (official build).