What you will be able to do
- Decide between the public internet and outbound private connectivity for external access, including the role, edition and cost requirements
- Explain what Data Connectivity Proxy reaches that a cloud private endpoint cannot, and how an integration routes traffic to it
- Compare an external function that uses an API integration and proxy service with a UDF that uses an external access integration, and pick the right one
1.Public internet or outbound private connectivity
When code in Snowflake calls an external endpoint, the traffic takes one of two network paths, and you choose the path before you create any objects. By default, a HOST_PORT egress rule sends traffic over the public internet. The alternative is outbound private connectivity, which uses the cloud providers' own links, described in Private connectivity (AWS PrivateLink, Azure Private Link, GCP Private Service Connect). Choose the private path when the security requirements for that connection rule out the public internet, for example when a UDF writes to a storage service and that traffic must stay off public networks.
Private connectivity has three requirements that the public path does not, and exam scenarios test each one:
- The person who configures it must have the ACCOUNTADMIN role.
- The account must be Business Critical Edition or higher.
- Private Link, PrivateLink or Private Service Connect adds a separate billing charge.
The network rule changes too. Instead of HOST_PORT, it uses TYPE = PRIVATE_HOST_PORT. This path only works when the destination is a cloud service that offers a private endpoint, such as Amazon S3 or Azure Storage. A database in your own data centre has no such endpoint.
Checkpoint 1 of 3· Check yourself
A security engineer using the ACCOUNTADMIN role wants a UDF to write to Amazon S3 over AWS PrivateLink so the traffic stays off the public internet. The account is Enterprise Edition. The engineer has drafted an EGRESS network rule with TYPE = PRIVATE_HOST_PORT. What prevents this design from working as planned?
Outbound private connectivity needs both the ACCOUNTADMIN role and Business Critical Edition or higher. The role is correct here, so the Enterprise Edition account is what blocks it. PRIVATE_HOST_PORT is the right rule type, and S3 is a cloud service that offers a private endpoint.
“If you choose to use private connectivity, your Snowflake account must be Business Critical Edition (or later).”Source: docs.snowflake.com
2.Data Connectivity Proxy for sources without a private endpoint
Data Connectivity Proxy (DCP) reverses the direction of the connection. You run a lightweight agent on a host inside your network. The agent makes one outbound connection on port 443 to Snowflake and keeps open an encrypted tunnel that Snowflake uses to reach the private source. Your firewall only sees outbound traffic: no inbound listener, no public IP and no VPN. The agent passes TCP traffic through without inspecting or storing it, and source credentials and connector logic stay in Snowflake. DCP is currently available for Snowflake Openflow.
DCP uses the same integration object. You add a network rule with MODE = DATA_CONNECTIVITY_PROXY_EGRESS to an external access integration, then attach that integration to the DCP object with EXTERNAL_ACCESS_INTEGRATIONS on CREATE DATA CONNECTIVITY PROXY or ALTER DATA CONNECTIVITY PROXY. Routing depends on the destination: the relay finds the integration that covers the requested host and port and sends the connection through that agent.
| Capability | DCP | PrivateLink / PSC / PE | Stable egress with IP allowlisting |
|---|---|---|---|
| Editions | Standard, Enterprise, Business Critical | Business Critical and higher only | Standard, Enterprise, Business Critical |
| Inbound ports required | None | None | Required on your side |
| Works across clouds and on-premises | Yes | CSP-native only | Yes |
| Setup complexity | Low (deploy agent, run bootstrap) | High (VPC/VNet configuration, DNS, peering) | Low (add IPs to firewall allowlist) |
Use outbound PrivateLink, PSC or Private Endpoint when the target is a cloud-native private endpoint and traffic must not cross the public internet. Use DCP when the source is on-premises, in another cloud, or anywhere without a cloud private endpoint, and inbound ports cannot be opened. Use stable egress IPs only when your firewall policy allows inbound rules based on IP addresses.
Checkpoint 2 of 3· Check yourself
An on-premises Oracle source will be reached through a Data Connectivity Proxy agent that is already running. Which Snowflake configuration tells the relay to send connections for that host and port through the agent?
DCP uses the same external access integration object, but the rule must have MODE = DATA_CONNECTIVITY_PROXY_EGRESS, and the integration is attached to the DCP object. The relay routes a connection by finding the integration that covers the requested host and port. PRIVATE_HOST_PORT is for cloud-native private endpoints, and INGRESS rules and network policies only control inbound traffic.
“include a network rule with MODE = DATA_CONNECTIVITY_PROXY_EGRESS in the integration, then associate the integration with the DCP object by using EXTERNAL_ACCESS_INTEGRATIONS”Source: docs.snowflake.com
3.External functions and API integrations compared
An external function is an older, separate way for SQL to call outside code, and it has a different trust chain. The function object holds no code. It stores the URL of an HTTPS proxy service, such as Amazon API Gateway or Azure API Management. Snowflake never calls the remote service directly: it POSTs JSON batches to the proxy, and the proxy forwards them to the remote service, such as an AWS Lambda or Azure Function, and passes the results back. The proxy can add security by authenticating requests to the remote service.
The API integration holds the security information Snowflake needs to work with the proxy or remote service. Creating one requires ACCOUNTADMIN or a role with CREATE INTEGRATION. The author of an external function needs USAGE on the API integration. If the gateway needs a subscription key, API_KEY on CREATE or ALTER API INTEGRATION supplies it. The key is optional, works alongside IAM rather than replacing it, and is hidden from query history and DESCRIBE INTEGRATION output. An external function can also read a secret to put credentials into an API authorization header. In that case the roles that create and call the function need USAGE on the secret.
| Aspect | UDF or procedure with an external access integration | External function with an API integration |
|---|---|---|
| Where the logic runs | Handler code (for example Python or Java) inside Snowflake | A remote service outside Snowflake, reached through a proxy service |
| Infrastructure you build | Network rule, secret, integration | Remote service, proxy service, API integration |
| Where credentials live | A secret allowed by the integration | Authentication information in the API integration, optional API_KEY, or a secret |
| Privilege to author the function | USAGE on the integration, READ on the secret | USAGE on the API integration |
Each approach fits a different situation. Suppose the logic is a short Python transformation plus a call to a REST API that uses OAuth, and no proxy service exists yet. A Python UDF with an external access integration and an OAUTH2 secret does the job, and there is no gateway to build or secure. An external function makes sense when the remote code is in a language a UDF cannot use, such as Go or C#, when it needs third-party libraries that internal UDFs cannot access, or when other software already calls the same service through the same interface.
A point where requests are checked: it can authenticate callers before they reach the remote service, and it can enforce subscription or usage rules. Snowflake only ever talks to the proxy, never directly to the remote service.
Checkpoint 3 of 3· Check yourself
Your team's Amazon API Gateway fronts a remote service for an external function, and the gateway now requires every caller to send a subscription key. The API integration already authenticates to AWS through IAM. What is the correct way to supply the key?
The optional API_KEY clause on CREATE or ALTER API INTEGRATION supplies the gateway's subscription key. It adds to IAM rather than replacing it, and Snowflake keeps it out of query history and DESCRIBE INTEGRATION output.
“An API_KEY is in addition to, not a substitute for, IAM (Identity and Access Management).”Source: docs.snowflake.com
Practise it for real
Build an external access path to an approved API, show that the allowlist blocks anything else, then disable the path as if containing an incident.
1.Create an egress rule: CREATE NETWORK RULE ... MODE = EGRESS TYPE = HOST_PORT VALUE_LIST = ('api.example.com:443').
Why: The rule is the allowlist. Only the host and port listed here can be reached.
You should see: The rule exists in the schema. Creating it needs CREATE NETWORK RULE on that schema.
2.Create a GENERIC_STRING secret that holds the API key, then CREATE EXTERNAL ACCESS INTEGRATION with ALLOWED_NETWORK_RULES = (your rule), ALLOWED_AUTHENTICATION_SECRETS = (your secret) and ENABLED = TRUE.
Why: The integration combines the approved destination and the approved credential.
You should see: The integration is created. Your role needs CREATE INTEGRATION on the account and USAGE on the secret and its schema.
3.Create a Python UDF with EXTERNAL_ACCESS_INTEGRATIONS = (your integration) and SECRETS = ('cred' = your secret), and read the key with get_generic_secret_string('cred').
Why: The SECRETS alias binds a secret the integration allows, so the key never appears as a literal in code.
You should see: The UDF calls api.example.com successfully.
4.Change the handler to call a host that is not in the rule, and run it.
Why: Shows that the allowlist is enforced.
You should see: The request is denied. A Deny row for the query appears in ACCOUNT_USAGE.EXTERNAL_ACCESS_HISTORY, possibly up to 180 minutes later.
5.Run ALTER EXTERNAL ACCESS INTEGRATION ... SET ENABLED = FALSE, then call the original UDF again.
Why: Practises containing an incident without dropping any objects.
You should see: The UDF can no longer reach api.example.com, and the function, rule and secret all still exist.
Stuck? Get a nudge
If the first call fails even though the host looks right, check whether the endpoint uses a port other than 443 and whether that port is written into the VALUE_LIST entry.
Sources
(7)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://docs.snowflake.com/en/developer-guide/external-network-access/creating-using-external-network-accessOfficial docs
“You might use private connectivity based on the security requirements of your connection to the external network location.”
↩︎ Public internet or outbound private connectivity“If you use private connectivity, the person configuring the interaction must have been assigned the ACCOUNTADMIN role.”
↩︎ Public internet or outbound private connectivity“Using Azure Private Link, AWS PrivateLink, or Google Cloud Private Service Connect incurs an additional billing charge.”
↩︎ Public internet or outbound private connectivity“include a network rule with MODE = DATA_CONNECTIVITY_PROXY_EGRESS in the integration”
↩︎ Data Connectivity Proxy for sources without a private endpoint“In addition, your Snowflake account must be Business Critical Edition (or higher).”
↩︎ Exam trap 1“include a network rule with MODE = DATA_CONNECTIVITY_PROXY_EGRESS in the integration, then associate the integration with the DCP object by using EXTERNAL_ACCESS_INTEGRATIONS”
↩︎ Checkpoint - 2.https://docs.snowflake.com/en/user-guide/data-integration/openflow/setup-openflow-spcs-dcpOfficial docs
“The source is a cloud service that offers a private endpoint, such as Amazon S3 or Azure Storage.”
↩︎ Public internet or outbound private connectivity - 3.
“The agent makes a single outbound connection on port 443 to Snowflake and establishes an encrypted tunnel.”
↩︎ Data Connectivity Proxy for sources without a private endpoint“Source credentials and connector logic remain entirely within Snowflake.”
↩︎ Data Connectivity Proxy for sources without a private endpoint“DCP is currently available for use with Snowflake Openflow.”
↩︎ Data Connectivity Proxy for sources without a private endpoint“without requiring you to open inbound firewall ports or expose your network to the public internet.”
↩︎ Prediction - 4.
“The proxy service can increase security by authenticating requests to the remote service.”
↩︎ External functions and API integrations compared“An API integration stores information, such as security information, that is needed to work with a proxy service or remote service.”
↩︎ External functions and API integrations compared“The code for the remote service can be written in languages that other UDFs cannot be written in”
↩︎ External functions and API integrations compared“Snowflake does not call a remote service directly.”
↩︎ Exam trap 2 - 5.
“Because an external function requires an API integration, the author of the external function must be granted USAGE privilege on the API integration.”
↩︎ External functions and API integrations compared“To create an API integration, you need ACCOUNTADMIN privileges or a Snowflake role with the CREATE INTEGRATION privilege.”
↩︎ External functions and API integrations compared“An API_KEY is in addition to, not a substitute for, IAM (Identity and Access Management).”
↩︎ External functions and API integrations compared - 6.
“For example, an external function needs to access and read the secret to pass the authentication credentials into an API authorization header”
↩︎ External functions and API integrations compared
Also cited
- https://docs.snowflake.com/en/developer-guide/external-network-access/external-network-access-overviewOfficial docs
“If you choose to use private connectivity, your Snowflake account must be Business Critical Edition (or later).”
↩︎ Checkpoint