Azure SQL to Snowflake via Microsoft Fabric OneLake Pipeline

Azure SQL to Snowflake via Microsoft Fabric OneLake and ADLS Gen2 - Complete Pipeline Guide

Celestinfo Software Solutions Pvt. Ltd. • Jan 22, 2026

Last updated: October 2026

Quick answer: To move data from Azure SQL to Snowflake via Microsoft Fabric, extract tables with a Fabric data pipeline into the Lakehouse Files folder as Parquet, then create a Snowflake storage integration and external stage on the OneLake blob endpoint. An ADLS Gen2 container reached through a Lakehouse shortcut also works if you want the files in your own storage account. A stored procedure that uses INFER_SCHEMA and COPY INTO then creates tables and loads new files on a schedule.

Introduction

This Azure SQL to Snowflake pipeline guide demonstrates how to build an end-to-end automated data ingestion pipeline using Microsoft Fabric OneLake. The pipeline extracts data from Azure SQL Database through Fabric data pipelines, stores it as Parquet in OneLake, and loads it through a Snowflake external stage, either directly on OneLake or through an optional ADLS Gen2 shortcut, with dynamic table creation.


Whether you are migrating data from Azure SQL to Snowflake or building an automated ELT pipeline, this Fabric-to-Snowflake approach provides a scalable, low-maintenance architecture with dynamic table creation and scheduled ingestion. For an alternative that queries the data in place, using Fabric mirroring and a Snowflake catalog-linked database over OneLake's Iceberg REST endpoint, see our guide on Fabric mirroring with OneLake Snowflake catalog integration.


Architecture Overview


The data flows through the following stages in this Fabric data pipeline:


Azure SQL DB → Fabric Pipeline → OneLake Lakehouse Files (optionally through an ADLS Gen2 shortcut) → Snowflake External Stage → Snowflake Dynamic Load


Tools and Technologies


Component Technology
Source Database Azure SQL Database
Pipeline / ETL Tool Microsoft Fabric Data Pipeline
Lakehouse Storage Microsoft Fabric Lakehouse (OneLake)
External Storage (optional) Azure Data Lake Storage Gen2 (ADLS Gen2)
Data Warehouse Snowflake
Automation Snowflake Stored Procedure + Task Scheduler

Step 1 - Create Microsoft Fabric Workspace


Begin by setting up a dedicated workspace in Microsoft Fabric to organize all pipeline resources. Open the Microsoft Fabric portal, navigate to Workspaces, and create a new workspace (for example, "azuresnow"). If you do not already have a Fabric capacity assigned, enable the Fabric Trial capacity to get started. The workspace serves as the container for your Lakehouse, data pipelines, and any other Fabric artifacts used in this integration.


Want this running in your own account? We build Snowflake platforms end to end: ingestion, modelling, access control, and the monitoring that tells you when a load drifts. Not slide decks. Not roadmaps. Real working systems you can point at.

Book a Snowflake call Snowflake consulting

Step 2 - Create a Lakehouse in Fabric


Within your newly created workspace, click New item → Lakehouse and name it (for example, "azuresnow_lakehouse"). The Microsoft Fabric Lakehouse provides a unified storage layer built on OneLake, enabling you to store structured and semi-structured data in an open format. This Lakehouse will serve as the intermediate staging area where extracted Parquet files from Azure SQL Database are stored before they are accessed by Snowflake.


Step 3 - Load Azure SQL Data into OneLake


Create a new Data Pipeline in Microsoft Fabric and add a Copy Data activity. Configure the activity with the following settings:



This Fabric data pipeline extracts data from Azure SQL Database and writes it as Parquet files into the OneLake Lakehouse. The Parquet format is ideal for downstream analytics and is natively supported by Snowflake external stages, making it the preferred format for automated data ingestion workflows.


Connecting Snowflake to OneLake


When this pipeline was first built, Snowflake was pointed at the onelake.dfs.fabric.microsoft.com endpoint and returned an IncorrectEndpointError (HTTP 400). The dfs endpoint is the wrong one for a Snowflake stage. Snowflake's CREATE STAGE reference now documents Microsoft Fabric OneLake as an external stage location on the blob endpoint, in the form azure://onelake.blob.fabric.microsoft.com/<workspace_id>/<item_id>/Files/<path>/, where Files is the mandatory path segment for Lakehouse items. The stage can authenticate through a storage integration or a SAS token.


A stage on Files/raw/ reads the pipeline's Parquet files where the Copy activity writes them, so the ADLS Gen2 account described next is optional. Two documented limits apply. Automatic directory refresh isn't supported for OneLake stages, so the directory has to be refreshed manually, which the DYNAMIC_LOAD procedure in Step 5 already does with ALTER STAGE ... REFRESH. Private connectivity endpoints aren't supported for OneLake storage locations either, so this route uses the public endpoint. Step 4 shows the SQL for both routes.


Option - ADLS Gen2 Shortcut Integration


If you want the files in an ADLS Gen2 account of your own, for example because other tools read them there too, an ADLS Gen2 shortcut still works. Follow these steps:


  1. Create an ADLS Gen2 Storage Account in Azure with Hierarchical Namespace enabled.
  2. Create a container named "fabricraw" (or your preferred name) within the storage account.
  3. In the Files section of the Fabric Lakehouse, create a Shortcut that points to the ADLS Gen2 container URL using SAS Token authentication.
  4. Change the Copy Data destination from Step 3 to the shortcut folder, for example Files/fabricraw/<table_name>/.

A shortcut makes the ADLS container appear as a folder inside the Lakehouse, and only files written into that folder are stored in the container. Files written to Files/raw/ stay in OneLake, where a stage on the ADLS account would never see them. With the destination from step 4, each file lands in the container at <table_name>/<file>.parquet. That is the layout the DYNAMIC_LOAD procedure expects, because it takes the table name from the first folder of the path.


Step 4 - Snowflake Integration Setup


The next step is to set up the Snowflake database, file format, storage integration and external stage. Sections 4.3 and 4.5 give the SQL for both routes, the direct OneLake stage and the ADLS Gen2 option, so run the version that matches your setup.


4.1 - Create Database and Schema

SQL - Snowflake Database Setup
CREATE OR REPLACE DATABASE FABRIC_DB;
CREATE OR REPLACE SCHEMA FABRIC_DB.RAW;

4.2 - Create Parquet File Format

SQL - Parquet File Format
CREATE OR REPLACE FILE FORMAT FABRIC_PARQUET_FMT
TYPE = PARQUET;

4.3 - Create Storage Integration

Note: Snowflake requires the blob endpoint, not the dfs endpoint, on both routes. OneLake uses onelake.blob.fabric.microsoft.com and ADLS Gen2 uses blob.core.windows.net. The tenant ID is the Microsoft Entra ID tenant that the Fabric workspace or the storage account belongs to.

SQL - Storage Integration (direct OneLake)
CREATE OR REPLACE STORAGE INTEGRATION FABRIC_ONELAKE_INT
TYPE = EXTERNAL_STAGE
STORAGE_PROVIDER = 'AZURE'
ENABLED = TRUE
AZURE_TENANT_ID = '<your-tenant-id>'
STORAGE_ALLOWED_LOCATIONS = ('azure://onelake.blob.fabric.microsoft.com/<workspace_id>/<item_id>/Files/raw/');
SQL - Storage Integration (ADLS Gen2 option)
CREATE OR REPLACE STORAGE INTEGRATION FABRIC_ADLS_INT
TYPE = EXTERNAL_STAGE
STORAGE_PROVIDER = 'AZURE'
ENABLED = TRUE
AZURE_TENANT_ID = '<your-tenant-id>'
STORAGE_ALLOWED_LOCATIONS = ('azure://dlsaazuresnow.blob.core.windows.net/fabricraw/');

4.4 - Grant Azure Consent

After creating the storage integration, you must grant consent in Microsoft Entra ID (formerly Azure Active Directory). Run the following command against the integration you created to retrieve the consent URL:

SQL - Retrieve Consent URL
DESC STORAGE INTEGRATION FABRIC_ONELAKE_INT;   -- or FABRIC_ADLS_INT for the ADLS Gen2 option
-- Copy the AZURE_CONSENT_URL value from the output
-- Open it in a browser and click Accept to grant consent

4.5 - Create External Stage

Both versions create a stage called FABRIC_STAGE, which is the name the Step 5 procedure uses. The LIST command at the end confirms that Snowflake can see the Parquet files, and for the ADLS Gen2 option it succeeds only after the role assignment in 4.6.

SQL - Snowflake External Stage (direct OneLake)
CREATE OR REPLACE STAGE FABRIC_DB.RAW.FABRIC_STAGE
URL = 'azure://onelake.blob.fabric.microsoft.com/<workspace_id>/<item_id>/Files/raw/'
STORAGE_INTEGRATION = FABRIC_ONELAKE_INT
FILE_FORMAT = FABRIC_DB.RAW.FABRIC_PARQUET_FMT
DIRECTORY = (ENABLE = TRUE);

LIST @FABRIC_DB.RAW.FABRIC_STAGE;
SQL - Snowflake External Stage (ADLS Gen2 option)
CREATE OR REPLACE STAGE FABRIC_DB.RAW.FABRIC_STAGE
URL = 'azure://dlsaazuresnow.blob.core.windows.net/fabricraw/'
STORAGE_INTEGRATION = FABRIC_ADLS_INT
FILE_FORMAT = FABRIC_DB.RAW.FABRIC_PARQUET_FMT
DIRECTORY = (ENABLE = TRUE);

LIST @FABRIC_DB.RAW.FABRIC_STAGE;

4.6 - Azure IAM Permission Configuration

For the ADLS Gen2 option, navigate to the storage account in the Azure portal. Under Access Control (IAM), assign the "Storage Blob Data Reader" role to the Snowflake Enterprise Application (the service principal created during the consent step). Reader access is enough to list and load the Parquet files, and Snowflake documents Storage Blob Data Contributor for the case where it also unloads data to the container. For the direct OneLake stage, Snowflake's stage documentation does not list the Fabric workspace permissions that the application needs, so we recommend confirming access with the LIST command above before you schedule the task.


Step 5 - Dynamic Table Creation and Data Loading


The core automation in this pipeline is a Snowflake stored procedure called DYNAMIC_LOAD. This procedure scans the external stage directory for new Parquet files, dynamically creates tables using INFER_SCHEMA, loads data with COPY INTO, and tracks processed files to prevent duplicate loading.


SQL - Dynamic Load Stored Procedure
CREATE OR REPLACE PROCEDURE FABRIC_DB.RAW.DYNAMIC_LOAD()
RETURNS STRING
LANGUAGE SQL
EXECUTE AS CALLER
AS
$$
BEGIN
    -- Create file tracking table if it does not exist
    CREATE TABLE IF NOT EXISTS FABRIC_DB.RAW.FILE_TRACKING (
        FILE_NAME STRING,
        TABLE_NAME STRING,
        LOADED_AT TIMESTAMP DEFAULT CURRENT_TIMESTAMP()
    );

    -- Refresh the external stage directory metadata
    ALTER STAGE FABRIC_DB.RAW.FABRIC_STAGE REFRESH;

    -- Loop through all Parquet files in the stage directory
    LET cur CURSOR FOR
        SELECT RELATIVE_PATH
        FROM DIRECTORY(@FABRIC_DB.RAW.FABRIC_STAGE)
        WHERE RELATIVE_PATH LIKE '%.parquet'
          AND RELATIVE_PATH NOT IN (SELECT FILE_NAME FROM FABRIC_DB.RAW.FILE_TRACKING);

    FOR rec IN cur DO
        LET file_path STRING := rec.RELATIVE_PATH;

        -- Extract table name from the file path (folder name)
        LET tbl_name STRING := UPPER(SPLIT_PART(file_path, '/', 1));

        -- Check if the table already exists
        LET tbl_count INTEGER := 0;
        SELECT COUNT(*) INTO :tbl_count
        FROM FABRIC_DB.INFORMATION_SCHEMA.TABLES
        WHERE TABLE_SCHEMA = 'RAW' AND TABLE_NAME = :tbl_name;

        -- Create table dynamically if it does not exist
        IF (tbl_count = 0) THEN
            EXECUTE IMMEDIATE
                'CREATE TABLE FABRIC_DB.RAW.' || tbl_name ||
                ' USING TEMPLATE (
                    SELECT ARRAY_AGG(OBJECT_CONSTRUCT(*))
                    FROM TABLE(
                        INFER_SCHEMA(
                            LOCATION => ''@FABRIC_DB.RAW.FABRIC_STAGE/' || file_path || ''',
                            FILE_FORMAT => ''FABRIC_DB.RAW.FABRIC_PARQUET_FMT''
                        )
                    )
                )';
        END IF;

        -- Load data from the Parquet file into the target table
        EXECUTE IMMEDIATE
            'COPY INTO FABRIC_DB.RAW.' || tbl_name ||
            ' FROM @FABRIC_DB.RAW.FABRIC_STAGE/' || file_path ||
            ' FILE_FORMAT = (FORMAT_NAME = FABRIC_DB.RAW.FABRIC_PARQUET_FMT)' ||
            ' MATCH_BY_COLUMN_NAME = CASE_INSENSITIVE';

        -- Track the loaded file
        INSERT INTO FABRIC_DB.RAW.FILE_TRACKING (FILE_NAME, TABLE_NAME)
        VALUES (:file_path, :tbl_name);

    END FOR;

    RETURN 'DYNAMIC_LOAD completed successfully.';
END;
$$;

How the Stored Procedure Works



We recommend running CALL FABRIC_DB.RAW.DYNAMIC_LOAD(); once in a development account and checking the FILE_TRACKING table before you schedule the procedure in Step 6.


Step 6 - Automate with Snowflake Tasks


To fully automate the data ingestion pipeline, create a Snowflake Task that invokes the DYNAMIC_LOAD stored procedure on a recurring schedule. This enables hands-free, scheduled data loading from ADLS Gen2 into Snowflake.


SQL - Snowflake Task Scheduler
CREATE OR REPLACE TASK FABRIC_AUTO_TASK
WAREHOUSE = COMPUTE_WH
SCHEDULE = '5 MINUTE'
AS
CALL FABRIC_DB.RAW.DYNAMIC_LOAD();

ALTER TASK FABRIC_AUTO_TASK RESUME;

The task runs every 5 minutes, automatically detecting and loading any new Parquet files that arrive in the ADLS Gen2 container. You can adjust the schedule interval based on your data freshness requirements. Use ALTER TASK FABRIC_AUTO_TASK SUSPEND; to pause the automated ingestion when needed.


Data Validation


After the pipeline executes, run the following validation queries in Snowflake to confirm that data has been loaded correctly and that all files have been tracked.


SQL - Validation Queries
-- Verify tables were created in the RAW schema
SHOW TABLES IN SCHEMA FABRIC_DB.RAW;

-- Check row counts for loaded tables
SELECT TABLE_NAME, ROW_COUNT
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'RAW' AND TABLE_CATALOG = 'FABRIC_DB';

-- Review file tracking log
SELECT * FROM FABRIC_DB.RAW.FILE_TRACKING ORDER BY LOADED_AT DESC;

-- Sample data from a loaded table
SELECT * FROM FABRIC_DB.RAW.<TABLE_NAME> LIMIT 10;

-- Verify task execution history
SELECT *
FROM TABLE(INFORMATION_SCHEMA.TASK_HISTORY(TASK_NAME => 'FABRIC_AUTO_TASK'))
ORDER BY SCHEDULED_TIME DESC
LIMIT 10;

Conclusion


This pipeline provides a fully automated, end-to-end solution for moving data from Azure SQL Database through Microsoft Fabric OneLake into Snowflake. Fabric data pipelines handle the extraction, a Snowflake stage reads the Parquet files from OneLake directly or through an ADLS Gen2 shortcut, and a stored procedure creates tables and loads new files on a schedule. Once your data lands in Snowflake, use dbt for ELT transformations and ensure proper governance, security, and cost controls.

Chakri, Junior Developer

Chakri is a Junior Developer at CelestInfo with hands-on experience across AWS, Azure, GCP, and Snowflake cloud infrastructure.


Frequently Asked Questions

Q: Can Snowflake read files directly from Microsoft Fabric OneLake?

Yes. Snowflake supports OneLake as an external stage location on the onelake.blob.fabric.microsoft.com endpoint, with a URL made up of the workspace ID, the item ID and the Files path. The IncorrectEndpointError appears when a stage uses the onelake.dfs endpoint. Automatic directory refresh isn't supported for OneLake stages, so the stage directory is refreshed manually, as the procedure in this guide does.

Q: Why does Snowflake use blob.core.windows.net instead of dfs.core.windows.net?

Snowflake's Azure storage integration works with the Azure Blob Storage endpoint (blob.core.windows.net). While ADLS Gen2 exposes both blob and dfs endpoints, Snowflake requires the blob endpoint for external stage operations. For OneLake, the equivalent is onelake.blob.fabric.microsoft.com.

Q: How does the dynamic table creation stored procedure work?

The procedure scans the external stage for new Parquet files, uses INFER_SCHEMA to detect column definitions, creates tables dynamically using USING TEMPLATE, and loads data with COPY INTO using MATCH_BY_COLUMN_NAME for flexible schema mapping.

Q: Can this pipeline handle schema changes in source data?

The pipeline does not pick up new columns automatically. The procedure runs INFER_SCHEMA only when a table does not exist yet, so a column added to the source later is not added to the Snowflake table, and COPY INTO with MATCH_BY_COLUMN_NAME does not load its values. Snowflake's schema evolution feature can add columns during COPY INTO, but Snowflake documents that it isn't supported by tasks, and this pipeline loads from a task. Add new columns with ALTER TABLE ... ADD COLUMN before the next scheduled load.

Related Articles

Burning Questions
About CelestInfo

Simple answers to make things clear.

Our AI insights are continuously trained on large datasets and validated by experts to ensure high accuracy.

Absolutely. CelestInfo supports integration with a wide range of industry-standard software and tools.

We implement enterprise-grade encryption, access controls, and regular audits to ensure your data is safe.

Insights are updated in real-time as new data becomes available.

We offer 24/7 support via chat, email, and dedicated account managers.

Still have questions?

Get Assistance

Ready? Let's Talk!

Get expert insights and answers tailored to your business requirements and transformation.

Get Assistance