Connecting to Snowflake
Connect your Snowflake accounts to CloudZero to bring your Snowflake cost data into a unified view of all your cloud and AI spend. CloudZero organizes your Snowflake costs, along with your other costs, into categories (called Dimensions) that matter most to your business. For example: business unit, team, product, feature, environment, customer, or virtually anything else. Once connected and organized, you can quickly answer questions about your spend that matter to your stakeholders.
This guide covers configuring a Snowflake connection and running the CloudZero SQL script in your Snowflake account. CloudZero connects through Snowflake's Secure Data Sharing, establishing a share from your account to CloudZero's Snowflake account in the same region. CloudZero ingests your Snowflake cost and usage data, including Cortex AI spend. All access is read-only.
CloudZero supports most commercial Snowflake regions on AWS, Azure, and GCP, but not government cloud regions (SnowGov). See Supported regions.
What you need
- CloudZero user with admin permissions
- Snowflake account with the ACCOUNTADMIN role. The SQL script runs as ACCOUNTADMIN by default to create roles, a database, a warehouse, a procedure, a task, and a share. The access it grants CloudZero is read-only.
- Snowflake's ORGADMIN role to include organization-level data. Without ORGADMIN, organization-level views are skipped. See How your Snowflake rates are determined for how this affects your cost data.
- Your Snowflake contract pricing:
| Value | How to find it |
|---|---|
| Cost per Credit (Capacity Credit Price) | Query the Rate_Sheet_Daily view, or find it on your Snowflake bill |
| Cost per TB/Month (Capacity Storage Price) | Same source as Cost per Credit |
| Cost Effective Date | The date your current pricing took effect |
Do not connect Snowflake reader accounts. Reader accounts do not have their own billing data. All costs are billed to the provider account, so CloudZero cannot collect cost data from a reader account.
Step 1: Configure the connection in CloudZero
- In CloudZero, go to Settings > Connections.
- Select Create Connection + and select the Snowflake tile.
- Enter the connection details:
| Field | Value |
|---|---|
| Connection Name | A name to identify this Snowflake account in CloudZero (for example, Production or Analytics) |
| Cost per Credit | Your Snowflake Capacity Credit Price |
| Cost per TB/Month | Your Snowflake Capacity Storage Price |
| Cost Effective Date | The date your pricing took effect. If your pricing has not changed since the account was created, use the account creation date. |
| Snowflake Account ID | Your Snowflake account identifier in lowercase. Run SELECT LOWER(CURRENT_ACCOUNT()); in Snowflake to find it. |
| Snowflake Account Region | Select the cloud provider and region of your Snowflake account from the list, for example AWS - US East (N. Virginia). Run SELECT CURRENT_REGION(); in Snowflake to find it. |
- Select Create Connection. CloudZero returns you to the Connections page.
Step 2: Run the CloudZero SQL script in Snowflake
- On the Connections page, select the Snowflake connection you created in Step 1.
- Copy the SQL script from the Setup Script section of the detail panel.
- Paste the script into a Snowflake worksheet in your account.
- Select the All Queries checkbox.
- Select Run.
The first run can take 3+ hours while Snowflake prepares the billing data. Subsequent runs take only a few minutes.
Step 3: Verify the connection
Return to Settings > Connections in CloudZero and refresh. Your Snowflake connection appears in the Billing Connections table.
What to expect
After CloudZero discovers the data share created by the SQL script, the connection status changes from Pending to Healthy:
- Discovery: Up to an hour after the SQL script completes.
- Cost data: Up to 24 hours for the initial sync. Once available, your Snowflake costs appear across the platform.
- Additional accounts: Each additional Snowflake billing account requires a separate connection. Follow the same process for each.
You can also query your CloudZero cost data directly from your own Snowflake account. See Query CloudZero Data in Snowflake for setup instructions.
Connection details
Tags
Snowflake tags are available in CloudZero for serverless features but not for standard warehouse queries:
| Usage type | Examples | Tags in CloudZero |
|---|---|---|
| Serverless features | Snowpipe, search optimization, automatic clustering | Yes. Tags on the associated table, schema, or database are available throughout CloudZero, including for cost allocation with CostFormation. |
| Warehouse queries | Standard user-driven queries | No. Usage is tracked at the warehouse level only. |
If tags are not appearing for a serverless feature, verify the tag is applied to the object, schema, or database in your Snowflake account using the
TAG_REFERENCESview.
Cortex AI
CloudZero captures Cortex AI spend through dedicated usage history views (listed in the Permissions table below). No additional configuration is required.
Cortex AI spend from these views appears under the Service element Snowflake Cortex. Each Cortex feature (such as ai_functions, analyst, code_cli, and agent) is its own Usage Family, and the resource is the feature plus the function, user, service, or agent name (for example, ai_functions/<function-name>). CloudZero subtracts these credits from warehouse metering so they are not counted twice. Cortex credits that the dedicated views do not cover stay under SnowflakeCompute.
Permissions
All CloudZero access is read-only. The SQL script in Step 2 creates the following resources in your Snowflake account and establishes a share to CloudZero:
| Resource | Name | Purpose |
|---|---|---|
| Role | CLOUDZERO_COPY_BILLING_DATA_ROLE | Reads data and executes the sync procedure |
| Database | CLOUDZERO_SHARED_DATA | Intermediate database between your billing views and the share |
| Warehouse | CLOUDZERO_COPY_BILLING_DATA | XSMALL warehouse that runs the sync and auto-suspends after 60 seconds; usage bills to your Snowflake account |
| Procedure | CLOUDZERO_COPY_BILLING_DATA | Syncs data periodically from billing tables and views |
| Task | CLOUDZERO_COPY_BILLING_DATA_TASK | Runs the sync procedure every 8 hours |
| Share | CLOUDZERO_SHARE | Shares data from CLOUDZERO_SHARED_DATA to CloudZero |
The script grants read access to the following tables and views:
| Schema | Table / View | Purpose |
|---|---|---|
ACCOUNT_USAGE | METERING_HISTORY | Credit usage by warehouse |
ACCOUNT_USAGE | METERING_DAILY_HISTORY | Daily credit usage by warehouse |
ACCOUNT_USAGE | DATABASE_STORAGE_USAGE_HISTORY | Storage usage by database |
ACCOUNT_USAGE | STAGE_STORAGE_USAGE_HISTORY | Storage usage by stage |
ACCOUNT_USAGE | WAREHOUSE_EVENTS_HISTORY | Warehouse lifecycle events |
ACCOUNT_USAGE | TAGS | Tag definitions |
ACCOUNT_USAGE | TAG_REFERENCES | Tag assignments to objects |
ORGANIZATION_USAGE | USAGE_IN_CURRENCY_DAILY | Organization-level spend (requires ORGADMIN role) |
ORGANIZATION_USAGE | REMAINING_BALANCE_DAILY | Contract balance tracking (requires ORGADMIN role) |
ORGANIZATION_USAGE | RATE_SHEET_DAILY | Contract pricing rates (requires ORGADMIN role) |
The script also collects Cortex AI usage data to surface AI-driven spend alongside the rest of your Snowflake costs:
| Schema | Table / View | Purpose |
|---|---|---|
ACCOUNT_USAGE | CORTEX_AGENT_USAGE_HISTORY | Agent workflows |
ACCOUNT_USAGE | CORTEX_AI_FUNCTIONS_USAGE_HISTORY | AI function invocations |
ACCOUNT_USAGE | CORTEX_ANALYST_USAGE_HISTORY | Natural language queries |
ACCOUNT_USAGE | CORTEX_CODE_CLI_USAGE_HISTORY | Code generation (CLI) |
ACCOUNT_USAGE | CORTEX_CODE_SNOWSIGHT_USAGE_HISTORY | Code generation (Snowsight) |
ACCOUNT_USAGE | CORTEX_DOCUMENT_PROCESSING_USAGE_HISTORY | Document processing |
ACCOUNT_USAGE | CORTEX_REST_API_USAGE_HISTORY | REST API calls |
ACCOUNT_USAGE | CORTEX_SEARCH_BATCH_QUERY_USAGE_HISTORY | Search batch queries |
ACCOUNT_USAGE | CORTEX_SEARCH_DAILY_USAGE_HISTORY | Search daily totals |
ACCOUNT_USAGE | CORTEX_SEARCH_SERVING_USAGE_HISTORY | Search serving |
Run
SHOW TABLES IN DATABASE CLOUDZERO_SHARED_DATA;in Snowflake to check which views are currently in your share.
Supported regions
| Cloud | Supported regions |
|---|---|
| AWS | US West (Oregon), US East (N. Virginia), US East (Ohio), Canada (Central), South America (Sao Paulo), EU (Ireland), EU (London), EU (Paris), EU (Frankfurt), EU (Stockholm), Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Osaka), Asia Pacific (Mumbai), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Jakarta) |
| Azure | East US 2 (Virginia), West Europe (Netherlands), Australia East (New South Wales), Canada Central (Toronto), Southeast Asia (Singapore), West US 2 (Washington), Switzerland North (Zurich), Central US (Iowa), Japan East (Tokyo, Saitama), North Europe (Ireland), South Central US (Texas), UAE North (Dubai), Central India (Pune), UK South (London) |
| GCP | US Central 1 (Iowa), Europe West 2 (London), Europe West 4 (Netherlands), US East 4 (N. Virginia) |
How your Snowflake rates are determined
CloudZero calculates your Snowflake costs using the best rate source available, in the following order:
- Your contract rates. If
RATE_SHEET_DAILYis available in your share (requires ORGADMIN), CloudZero uses your negotiated rates per service per day. If a rate is missing for a given day, CloudZero uses the most recent available rate for that service. - Your organization-level spend. If contract rates are not available, CloudZero calculates an effective rate by dividing your total spend by total usage units from
USAGE_IN_CURRENCY_DAILY(requires ORGADMIN). This rate can vary from day to day based on actual usage. - The values you entered during setup. If neither source is available, CloudZero applies Cost per Credit to all services except storage, which uses Cost per TB/Month, from Step 1.
Maintenance and configuration
Delete a connection
To delete a Snowflake connection, go to Settings > Connections, select the connection, and select Delete.
Update a legacy connection
If your Snowflake account is outside the us-east-1 region and uses the legacy S3-based ingestion method, update the AWS Identity and Access Management (IAM) trust relationship. See Update a legacy Snowflake connection for details.
Script versioning
CloudZero periodically updates the SQL script generated in Step 1. The version number is shown in the script header when CloudZero generates it.
If you connected your Snowflake account previously, regenerate and re-run the script to pick up the latest changes. The updated script replaces the previous setup automatically. No additional configuration is required.
| Version | What changed |
|---|---|
| 1.6 | Removed a deprecated Cortex AI view (CORTEX_AISQL_USAGE_HISTORY) |
| 1.5 | Updated connection identifier format; added contract rate detection (RATE_SHEET_DAILY) and Cortex Code cost tracking |
| 1.4 | Base version |
To get the latest script, go to Settings > Connections, select your Snowflake connection, and copy the script from the Setup Script section of the detail panel. Run it in Snowflake as described in Step 2.
A connection set up with an earlier script version can show Healthy with a Recommendation badge on the Connections page and an Additional tables missing or empty finding. The connection is working as expected, and re-running the latest script adds the optional tables that CloudZero reads cost data from. The ORGANIZATION_USAGE tables also require the ORGADMIN role. For more on findings, see Connection Health.
Have questions or feedback? Reach out to your account manager.
Updated 4 days ago

