2023-06-10 21:00:59 +00:00
---
slug: /en/engines/table-engines/integrations/azureBlobStorage
2023-06-23 13:16:22 +00:00
sidebar_position: 10
2023-06-10 22:20:39 +00:00
sidebar_label: Azure Blob Storage
2023-06-10 21:00:59 +00:00
---
# AzureBlobStorage Table Engine
2023-06-10 22:20:39 +00:00
This engine provides an integration with [Azure Blob Storage ](https://azure.microsoft.com/en-us/products/storage/blobs ) ecosystem.
2023-06-10 21:00:59 +00:00
2023-06-10 22:20:39 +00:00
## Create Table
2023-06-10 21:00:59 +00:00
``` sql
CREATE TABLE azure_blob_storage_table (name String, value UInt32)
ENGINE = AzureBlobStorage(connection_string|storage_account_url, container_name, blobpath, [account_name, account_key, format, compression])
[PARTITION BY expr]
[SETTINGS ...]
```
2023-06-10 22:20:39 +00:00
### Engine parameters
2023-06-10 21:00:59 +00:00
- `connection_string|storage_account_url` — connection_string includes account name & key ([Create connection string](https://learn.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string?toc=%2Fazure%2Fstorage%2Fblobs%2Ftoc.json& bc=%2Fazure%2Fstorage%2Fblobs%2Fbreadcrumb%2Ftoc.json#configure-a-connection-string-for-an-azure-storage-account)) or you could also provide the storage account url here and account name & account key as separate parameters (see parameters account_name & account_key)
- `container_name` - Container name
2023-08-09 12:30:33 +00:00
- `blobpath` - file path. Supports following wildcards in readonly mode: `*` , `**` , `?` , `{abc,def}` and `{N..M}` where `N` , `M` — numbers, `'abc'` , `'def'` — strings.
2023-06-10 21:00:59 +00:00
- `account_name` - if storage_account_url is used, then account name can be specified here
- `account_key` - if storage_account_url is used, then account key can be specified here
2023-06-10 22:20:39 +00:00
- `format` — The [format ](/docs/en/interfaces/formats.md ) of the file.
2023-06-10 21:00:59 +00:00
- `compression` — Supported values: `none` , `gzip/gz` , `brotli/br` , `xz/LZMA` , `zstd/zst` . By default, it will autodetect compression by file extension. (same as setting to `auto` ).
2023-06-10 22:20:39 +00:00
2023-06-11 07:55:20 +00:00
**Example**
``` sql
2023-06-23 13:16:22 +00:00
CREATE TABLE test_table (key UInt64, data String)
ENGINE = AzureBlobStorage('DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite1:10000/devstoreaccount1/;',
2023-06-11 07:55:20 +00:00
'test_container', 'test_table', 'CSV');
INSERT INTO test_table VALUES (1, 'a'), (2, 'b'), (3, 'c');
SELECT * FROM test_table;
```
```text
┌─key──┬─data──┐
│ 1 │ a │
│ 2 │ b │
│ 3 │ c │
└──────┴───────┘
```
2023-11-22 18:21:30 +00:00
## Virtual columns {#virtual-columns}
- `_path` — Path to the file. Type: `LowCardinalty(String)` .
- `_file` — Name of the file. Type: `LowCardinalty(String)` .
- `_size` — Size of the file in bytes. Type: `Nullable(UInt64)` . If the size is unknown, the value is `NULL` .
2023-06-10 22:20:39 +00:00
## See also
2023-06-13 22:40:14 +00:00
[Azure Blob Storage Table Function ](/docs/en/sql-reference/table-functions/azureBlobStorage )