> ## Documentation Index
> Fetch the complete documentation index at: https://docs.startree.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Iceberg REST catalogs + Azure and GCS

> Read Apache Polaris, Snowflake Open Catalog, Snowflake Horizon and other Iceberg REST catalog tables whose data lives in Azure Blob Storage, ADLS Gen2 or Google Cloud Storage.

> [!WARNING]
>
> **Preview.** Azure storage is in Preview from StarTree Cloud 0.18. Contact StarTree support to enable it for your environment. GCS storage is also in Preview.

This page covers Iceberg tables in Apache Polaris, Snowflake Open Catalog, Snowflake Horizon Catalog, Nessie and other Iceberg REST catalogs (`catalog_type = 'rest'`) when the data files are in Azure or Google Cloud Storage. Catalog sign-in works the same as on S3, so set it up as described in [Apache Polaris and Snowflake Open Catalog](https://docs.startree.ai/corecapabilities/external-table/polaris/onboarding-api.md), [Snowflake Horizon](https://docs.startree.ai/corecapabilities/external-table/horizon/onboarding-api.md) or [Nessie](https://docs.startree.ai/corecapabilities/external-table/nessie/onboarding-api.md). This page covers the storage settings.

For Unity Catalog, see [Unity Catalog + ADLS](https://docs.startree.ai/corecapabilities/external-table/unity/adls/onboarding-data-portal.md) and [Unity Catalog + GCS](https://docs.startree.ai/corecapabilities/external-table/unity/gcs/onboarding-data-portal.md) instead.

## What's supported

| Storage | How Pinot gets storage credentials | Status |
| - | - | - |
| Azure Blob Storage or ADLS Gen2 | A SAS token you configure | Preview, StarTree Cloud 0.18 and later |
| Google Cloud Storage | StarTree's own Google identity, with read-only access to your bucket | Preview |

You create these tables with [SQL DDL](https://docs.startree.ai/corecapabilities/external-table/sql-ddl.md). The Data Portal wizard doesn't offer Azure or GCS storage for these catalogs.

These aren't supported:

* **Credentials vended by the catalog.** If the catalog returns short-lived Azure or GCS credentials, Pinot ignores them and uses the SAS token or Google identity you set up here.
* **The `unity` and `biglake-vended` access policies.** They only work with Databricks Unity Catalog and Google BigLake.
* **`storage.access_policy` with Azure.** Azure storage always uses the SAS token you configure.

## Azure with a SAS token

This example reads a Polaris table. The catalog lines are the same ones you'd use for S3; only the `storage.*` lines change.

```sql theme={null}
CREATE TABLE polaris_azure_events WITH (
  type = 'iceberg',
  catalog_type = 'rest',
  catalog_uri = 'https://<polaris-host>/api/catalog',
  catalog_name = '<polaris-catalog>',
  schema_name = '<namespace>',
  table_name = '<table>',
  auth_type = 'oauth',
  client_id = '<client-id>',
  client_secret = '<client-secret>',
  oauth_scope = 'PRINCIPAL_ROLE:ALL',
  storage.provider = 'azure',
  storage.sas_token = 'srn2:secret#<sas-reference>',
  storage.credential_prefix = 'abfss://<container>@<account>.dfs.core.windows.net/<path>',
  refresh_interval = '5m'
);
```

For Snowflake Open Catalog, `catalog_uri` is `https://<orgname>-<account_name>.snowflakecomputing.com/polaris/api/catalog`. In both cases the token URI defaults to `<catalog_uri>/v1/oauth/tokens`, which is where Polaris issues tokens.

`storage.sas_token` and `storage.credential_prefix` are both required. With `storage.provider = 'azure'`, these options are rejected: `storage.region`, `storage.access_key`, `storage.secret_key`, `storage.session_token`, `storage.endpoint` and `storage.access_policy`.

**The SAS token must:**

* grant read (`r`) and list (`l`)
* have an expiry (`se`) and not be expired yet
* have a start time (`st`), if set, that isn't in the future
* include `ske` if it's a user-delegation SAS

**The credential prefix** is the container and path the SAS covers. Every data file the table reads has to sit under it, in the same storage account and container. `abfs://`, `abfss://`, `wasb://`, `wasbs://` and `https://<account>.blob.core.windows.net/...` or `.dfs.core.windows.net/...` are all accepted, and the `.blob` and `.dfs` forms of an account count as the same location. Only public Azure endpoints work.

**Rotating the token.** Pinot pins the token it first read. If you change the secret behind the same reference, reads fail. To rotate, store the new token under a new secret reference and update the table to point at it.

When you create the table, Pinot lists the table's data files with the SAS. If it can't, `CREATE TABLE` fails; there's no fallback to checking only the table root. Set `validate_storage = 'false'` to skip the check.

[Cursor pagination](https://docs.startree.ai/corecapabilities/query_data/advanced_operations/cursor-pagination.md) isn't supported on Azure tables.

## GCS with StarTree's Google identity

Before you start, grant StarTree's Google identity `storage.objects.get` and `storage.objects.list` on the bucket. The **Storage Object Viewer** role covers both. Contact StarTree support for the identity to grant. If your organization enforces the `iam.allowedPolicyMemberDomains` policy, your GCP admin may need to allow that identity's domain first.

```sql theme={null}
CREATE TABLE polaris_gcs_events WITH (
  type = 'iceberg',
  catalog_type = 'rest',
  catalog_uri = 'https://<polaris-host>/api/catalog',
  catalog_name = '<polaris-catalog>',
  schema_name = '<namespace>',
  table_name = '<table>',
  auth_type = 'oauth',
  client_id = '<client-id>',
  client_secret = '<client-secret>',
  oauth_scope = 'PRINCIPAL_ROLE:ALL',
  storage.provider = 'gcs',
  storage.access_policy = 'gcs-adc',
  refresh_interval = '5m'
);
```

`gcs-adc` is the default with `storage.provider = 'gcs'`, so you can leave `storage.access_policy` out.

GCS takes no storage keys. These options are rejected with `storage.provider = 'gcs'`: `storage.region`, `storage.access_key`, `storage.secret_key`, `storage.session_token`, `storage.endpoint`, `storage.sas_token` and `storage.credential_prefix`.

The table's location and its data files must be `gs://<bucket>/<path>` URIs in one bucket.

## Snowflake Horizon

Horizon signs in with a programmatic access token (PAT) sent without a client ID. The `client_id` and `client_secret` options can't express that, and `oauth_scope` only takes effect alongside them. So pass Horizon's catalog keys through as quoted options, exactly as in the [Horizon onboarding page](https://docs.startree.ai/corecapabilities/external-table/horizon/onboarding-api.md), and add the storage lines:

```sql theme={null}
CREATE TABLE horizon_azure_events WITH (
  type = 'iceberg',
  catalog_type = 'rest',
  catalog_uri = 'https://<orgname>-<account_name>.snowflakecomputing.com/polaris/api/catalog',
  catalog_name = '<database>',
  schema_name = '<schema>',
  table_name = '<table>',
  'catalog.iceberg-rest.prefix' = '<database>',
  'catalog.iceberg-rest.credential' = '<pat>',
  'catalog.iceberg-rest.auth.rest.authType' = 'oauth2',
  'catalog.iceberg-rest.auth.rest.oauthTokenUri' = 'https://<orgname>-<account_name>.snowflakecomputing.com/polaris/api/catalog/v1/oauth/tokens',
  'catalog.iceberg-rest.auth.rest.oauthScopes' = 'session:role:<role>',
  storage.provider = 'azure',
  storage.sas_token = 'srn2:secret#<sas-reference>',
  storage.credential_prefix = 'abfss://<container>@<account>.dfs.core.windows.net/<path>',
  refresh_interval = '5m'
);
```

* `<role>` must match the role the PAT is restricted to.
* `catalog_name` and `'catalog.iceberg-rest.prefix'` are both the Snowflake database name.
* For a GCS external volume, swap the three `storage.*` lines for `storage.provider = 'gcs'`.
* `CREATE TABLE` returns a warning for each quoted key, saying it was passed through. That's expected.

## Nessie and other REST catalogs

Use the same `storage.*` lines as above. For Nessie, `catalog_uri` is `<nessie-base-url>/iceberg`, and `'catalog.iceberg-rest.prefix' = '<branch>'` picks a branch other than the server default. Use `auth_type = 'token'` with `token`, or leave the auth options out if the server doesn't need them.

## Common errors

| Error | Cause |
| - | - |
| `Unsupported storage.provider: 'gcs'; supported: 's3', 'azure'.` | Your environment is on StarTree Cloud 0.18 or earlier, which has no GCS storage |
| `storage.access_policy requires a storage.provider that accepts an explicit policy.` | `storage.access_policy` is set with `storage.provider = 'azure'`, or without `storage.provider`. Remove it |
| `CREATE TABLE ... WITH (type = 'iceberg') requires the 'storage.sas_token' option.` | `storage.provider = 'azure'` without `storage.sas_token`. The same error names `storage.credential_prefix` when that's missing |
| `Azure SAS options require storage.provider = 'azure'.` | `storage.sas_token` or `storage.credential_prefix` without `storage.provider = 'azure'` |
| `Option '<key>' is incompatible with Azure SAS storage.` | An S3 option such as `storage.region` alongside `storage.provider = 'azure'` |
| `Option '<key>' is incompatible with storage.provider = 'gcs'.` | A storage key or SAS option alongside `storage.provider = 'gcs'` |
| `An expiring read/list SAS is required` | The SAS is missing its signature or expiry, or doesn't grant both read and list |
| `Azure SAS has expired` or `Azure SAS is not yet valid` | The SAS expiry has passed, or its start time is in the future |
| `Missing Azure delegation-key expiry` | A user-delegation SAS without `ske` |
| `Azure source location is outside its configured credential scope` | A data file sits outside `storage.credential_prefix`: a different account, container or path |
| `Azure source requires a public Azure storage endpoint` | The location isn't on `<account>.blob.core.windows.net` or `<account>.dfs.core.windows.net` |
| `Azure source SAS credential changed; reload the source configuration before reading` | The secret behind the SAS reference changed. Store the new token under a new reference and update the table |
| `Credential-backed external tables do not support stored result cursors` | A cursor query on an Azure table |
| `Unsupported external table authorization policy` | `storage.access_policy` isn't a policy name Pinot recognizes. Check the spelling of `gcs-adc` |
| `External table authorization policy is unavailable` | `storage.access_policy` is `unity` or `biglake-vended`. These catalogs can't vend credentials to Pinot; use `gcs-adc` |
| `Cannot read the selected GCS data file. Check the source storage authorization and object location.` | The check at create time couldn't read a data file. Usually StarTree's identity doesn't have read access to the bucket yet |
| `Invalid GCS source location` | The table location isn't a valid `gs://<bucket>/<path>` URI |
| `GCS source location is outside its configured bucket` | A data file points to a different bucket from the table's |
| `GCS source object was not found` | A file listed in the table's metadata is gone from the bucket |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.