An external stage is a Snowflake object in a schema that exposes files stored in external cloud storage. It stores the storage location, access parameters, and optional file-format settings, giving SQL pipelines a named source for staged files. section 3.1
External stages work with Amazon S3, Google Cloud Storage, and Microsoft Azure Blob Storage, regardless of where the Snowflake account runs. They differ from internal stages, whose files reside in cloud storage hosting the Snowflake account. section 2.2 section 3.1
Create and use an external stage in a loading pipeline:
- Create or obtain access to a cloud storage container and provide its URL when creating the stage. section 3.1
- Prefer a storage integration, which encapsulates credentials and lets the cloud provider control Snowflake access. section 3.1.3
- Use direct credentials only when a rapid test or proof of concept cannot wait for an integration; Azure SAS tokens expire. section 3.1.3
- Inspect available files with LIST and query staged content with SELECT before loading. section 5.2.2
- Load files into a staging table with COPY, selecting metadata$filename when source-file lineage is needed. section 3.1.4
Azure JSON stage
A stage can combine a storage integration, an Azure container URL, and a JSON file format. LIST verifies that files are visible; SELECT $1 reads each JSON document as a variant value before extraction or loading. section 5.2.2
create stage SPEEDY_STAGE storage_integration = SPEEDY_INTEGRATION url = 'azure://speedyorders001.blob.core.windows.net/speedyservicefiles/' file_format = (type = json);
This executable definition shows the three core configuration choices: storage integration, cloud URL, and file format. section 5.2.2
COPY from an external stage follows the same basic pattern as loading from a named internal stage. Snowflake tracks loaded-file metadata per target table, helping repeated or simultaneous COPY executions avoid duplicate file loads. Reusable named file formats reduce repeated format declarations. section 3.5
Plan the stage as part of pipeline operations. A directory table can retain stage-file metadata; file sizing and a dedicated loading warehouse affect ingestion efficiency. PURGE on an external stage requires cloud permissions that allow Snowflake to remove files. section 3.1.4 section 3.5
External stages also support pipelines beyond batch CSV loading: they can expose JSON files for relational extraction and act as the cloud-file boundary for continuous ingestion with Snowpipe. section 4.0 section 5.0
