- Categories:
User & Security DDL (Third-Party Service Integrations)
CREATE NOTIFICATION INTEGRATION¶
Creates a new notification integration in the account or replaces an existing integration. A notification integration is a Snowflake object that provides an interface between Snowflake and third-party cloud message queuing services.
In this Topic:
Syntax¶
CREATE [ OR REPLACE ] NOTIFICATION INTEGRATION [IF NOT EXISTS]
<name>
ENABLED = { TRUE | FALSE }
TYPE = QUEUE
cloudProviderParams
[ COMMENT = '<string_literal>' ]
Where:
cloudProviderParams (for Google Cloud Storage) ::= NOTIFICATION_PROVIDER = GCP_PUBSUB GCP_PUBSUB_SUBSCRIPTION_NAME = '<subscription_id>'cloudProviderParams (for Microsoft Azure) ::= NOTIFICATION_PROVIDER = AZURE_STORAGE_QUEUE AZURE_STORAGE_QUEUE_PRIMARY_URI = '<queue_URL>' AZURE_TENANT_ID = '<directory_ID>';
Required Parameters¶
name
String that specifies the identifier (i.e. name) for the integration; must be unique in your account.
In addition, the identifier must start with an alphabetic character and cannot contain spaces or special characters unless the entire identifier string is enclosed in double quotes (e.g.
"My object"
). Identifiers enclosed in double quotes are also case-sensitive.For more details, see Identifier Requirements.
ENABLED = TRUE | FALSE
Specifies whether to initiate operation of the integration or suspend it.
TRUE
enables the integration.FALSE
disables the integration for maintenance. Any integration between Snowflake and a third-party service fails to work.
TYPE = QUEUE
Specify the type of integration:
QUEUE
: Creates an interface between Snowflake and a third-party cloud message queuing service.
Cloud Provider Parameters (cloudProviderParams
)¶
Google Cloud Storage
NOTIFICATION_PROVIDER = GCP_PUBSUB
Specify the cloud provider:
GCP_PUBSUB
: Specifies Google Cloud Pub/Sub as the third-party cloud message queuing service.GCP_PUBSUB_SUBSCRIPTION_NAME = '<subscription_id>'
Pub/Sub topic subscription ID used to allow Snowflake access to event messages.
Microsoft Azure
NOTIFICATION_PROVIDER = AZURE_STORAGE_QUEUE
Specify the cloud provider:
AZURE_STORAGE_QUEUE
: Specifies Microsoft Azure Event Grid as the third-party cloud message queuing service.AZURE_STORAGE_QUEUE_PRIMARY_URI = 'https://storage_queue_account.queue.core.windows.net/storage_queue_name'
Specifies the queue ID for the Azure Queue Storage queue created for Event Grid notifications.
Note
An Azure Queue Storage queue supports a single notification integration. Referencing a single storage queue in multiple notification integrations can result in missing data in target tables because event notifications are split between notification integrations.
For more information, see:
AZURE_TENANT_ID = 'ad_directory_id'
Specifies the ID of the Azure Active Directory tenant used for identity management. This ID is needed to generate the consent URL that grants Snowflake access to the Event Grid notification subscription, which is used to automatically trigger Snowpipe loads of new files in blob storage.
Optional Parameters¶
COMMENT = 'string_literal'
String (literal) that specifies a comment for the integration.
Default: No value
Usage Notes¶
Only account administrators (users with the ACCOUNTADMIN role) or a role with the global CREATE INTEGRATION privilege can execute this SQL command.
Examples¶
Google Cloud Storage
CREATE NOTIFICATION INTEGRATION my_notification_int TYPE = QUEUE NOTIFICATION_PROVIDER = GCP_PUBSUB ENABLED = true GCP_PUBSUB_SUBSCRIPTION_NAME = 'projects/project-1234/subscriptions/sub2';
Microsoft Azure
CREATE NOTIFICATION INTEGRATION my_notification_int ENABLED = true TYPE = QUEUE NOTIFICATION_PROVIDER = AZURE_STORAGE_QUEUE AZURE_STORAGE_QUEUE_PRIMARY_URI = 'https://myqueue.queue.core.windows.net/mystoragequeue' AZURE_TENANT_ID = 'a123bcde-1234-5678-abc1-9abc12345678';