Integrating ServiceNow with Snowflake: API-Based Data Migration
Snowflake’s External Access Integration is a powerful feature that enables users to access and process data stored in external systems. This makes it ideal for data migration tasks, such as moving datasets from ServiceNow to Snowflake.
To connect to ServiceNow via an external API integration, you will need the instance credentials. These are different from your regular ServiceNow login and password.
To get the ServiceNow instance credentials for external API integration:
- Go to the ServiceNow Developer Portal.
- Click on your profile picture to open the drop-down menu.
- Click Manage Instance Password.
- Copy the instance name, username, and password.
You will use these credentials in the external API integration.
Before fetching data from ServiceNow, it’s vital to set up specific rules and integrations in Snowflake:
Create a Network Rule:
The rule helps define which hosts your Snowflake instance can access. Here, we created a rule named ‘servicenow_network_rule’ specifically for the ServiceNow domain.
Set Up External Access Integration:
This allows your Snowflake instance to use the above network rule, enabling it to access external data sources securely.
Fetching data from ServiceNow:
With the setup ready, you can create a function in Snowflake to fetch data from ServiceNow
This function, ServiceNow_getdata()
, uses Python to call the ServiceNow API and fetch data from a specified table. Note that in this example, the API endpoint and credentials are hardcoded for simplicity. In real-life scenarios, ensure these details are secured and not hardcoded.
You can now call this function in Snowflake and view the data returned or write a scheduled task to fetch and store the data in table:
With these simple steps, you’ve effectively created a bridge between ServiceNow and Snowflake using API integration.
Final Thoughts:
Snowflake’s ability to integrate with external services using API connections is a testament to its versatility and commitment to providing a unified platform for all your data needs. This integration is a game-changer for businesses needing to migrate, integrate, or analyze data across platforms. As more services offer APIs, the power of Snowflake’s EXTERNAL ACCESS INTEGRATION is sure to be even more appreciated.
For those eager to explore further, the publicapi.dev portal offers a comprehensive list of public APIs, providing a playground for data enthusiasts.
Note: Always ensure you follow best practices when dealing with sensitive information such as API credentials. In our example, we’ve kept things simple, but always prioritize security in real-world implementations.
Native Snowflake Connector for ServiceNow
Snowflake has recently rolled out a Native Integration for ServiceNow, currently in public preview. This integration is tailored for real-world scenarios, offering benefits like immediate access to live data and efficient handling of extensive data migrations. For an in-depth look into the capabilities of Snowflake’s Native ServiceNow Connector, dive into these. links
https://other-docs.snowflake.com/en/connectors/servicenow/index
https://www.snowflake.com/blog/snowflake-connector-servicenow-in-public-preview/
Refer to Snowflake’s official documentation on external network access.