- Categories:
System functions (System Control)
SYSTEM$PROVISION_PRIVATELINK_ENDPOINT¶
Provisions a private connectivity endpoint in the Snowflake VPC or VNet to enable Snowflake to connect to an external service using private connectivity. The endpoint can be a service endpoint or a resource endpoint depending on the cloud platform that hosts your Snowflake account.
Syntax¶
SYSTEM$PROVISION_PRIVATELINK_ENDPOINT(
'<provider_resource_id>' ,
'<host_name>' ,
'<subresource>'
)
Arguments¶
provider_resource_id
Specifies the fully-qualified identifier for the resource or service in your VPC or VNet.
'subresource'
Specifies the name of the subresource in the
host_name
argument; thehost_name
value is used when provisioning the private endpoint.If you want to use outbound private connectivity with the following services, specify these values:
External network access on Microsoft Azure: If the hostname value is
externalaccessdemo.database.windows.net
, thesubresource
value issqlServer
.External stages on Microsoft Azure: If the hostname value is
storagedemo.blob.core.windows.net
, thesubresource
value isblob
.
For all supported values, see the Sub-resource table.
'host_name'
Specifies the fully-qualified hostname to access the resource in your VPC or VNet.
This value does not contain any port numbers and must match what you specified in the Snowflake object that enables you to connect to the external service. For example:
Microsoft Azure API Management: the value must match the
API_ALLOWED_PREFIXES
property of the API integration. Do not includehttps://
.For examples, see the configuration procedure for external functions that use private connectivity for the Azure Portal and Azure ARM template.
Returns¶
Returns a status message that the endpoint was provisioned successfully or details and instructions about why the endpoint was not provisioned successfully.
Usage notes¶
Only account administrators (users with the ACCOUNTADMIN role) can call this function.
You cannot modify an existing private connectivity endpoint. To deprovision the endpoint, call the SYSTEM$DEPROVISION_PRIVATELINK_ENDPOINT system function.
This function can take approximately 5 minutes to execute because it depends on the process to provision the private connectivity endpoint in the cloud platform (outside of Snowflake).
For details about private endpoint limits, see Scaling considerations.
Examples¶
Provision a private endpoint to allow Snowflake on Microsoft Azure to connect to the Microsoft Azure API Management service in your Microsoft Azure VNet:
SELECT SYSTEM$PROVISION_PRIVATELINK_ENDPOINT(
'/subscriptions/f4b00c5f-f6bf-41d6-806b-e1cac4f1f36f/resourceGroups/aztest1-external-function-rg/providers/Microsoft.ApiManagement/service/aztest1-external-function-api',
'aztest1-external-function-api.azure.net',
'Gateway'
);
Private endpoint with ID "/subscriptions/e48379a7-2fc4-473e-b071-f94858cc83f5/resourcegroups/test_rg/providers/microsoft.network/privateendpoints/32bd3122-bfbd-417d-8620-1a02fd68fcf8" to resource "/subscriptions/f4b00c5f-f6bf-41d6-806b-e1cac4f1f36f/resourceGroups/aztest1-external-function-rg/providers/Microsoft.ApiManagement/service/aztest1-external-function-api" has been provisioned successfully. Please note down the endpoint ID and approve the connection from it on the Azure portal.
Provision a private endpoint to allow Snowflake on Microsoft Azure to connect to an external service using external network access:
SELECT SYSTEM$PROVISION_PRIVATELINK_ENDPOINT(
'/subscriptions/11111111-2222-3333-4444-5555555555/resourceGroups/leorg1/providers/Microsoft.Sql/servers/myserver/databases/testdb',
'testdb.database.windows.net',
'sqlServer'
);
"Resource Endpoint with id "/subscriptions/f0abb333-1b05-47c6-8c31-dd36d2512fd1/resourceGroups/privatelink-test/providers/Microsoft.Network/privateEndpoints/external-network-access-pe" provisioned successfully"
Provision a private endpoint to allow Snowflake to connect to an external stage for Microsoft Azure:
SELECT SYSTEM$PROVISION_PRIVATELINK_ENDPOINT(
'/subscriptions/cc2909f2-ed22-4c89-8e5d-bdc40e5eac26/resourceGroups/mystorage/providers/Microsoft.Storage/storageAccounts/storagedemo',
'storagedemo.blob.core.windows.net',
'blob'
);
"Resource Endpoint with id "/subscriptions/57faea9a-20c2-4d35-b283-9c0c1e9593d8/resourceGroups/privatelink-test/providers/Microsoft.Network/privateEndpoints/external-network-access-pe" provisioned successfully"