Skip to main content

Connect to Snowflake from ArcGIS

To connect to a Snowflake cloud data warehouse, install and configure client files to implement communication between ArcGIS and Snowflake and create database connection files from ArcGIS Pro. For best performance, deploy ArcGIS clients and the data warehouse in the same Snowflake cloud environment.

Typically, IT professionals install the ArcGIS software and the drivers required to connect to the data warehouse. They also configure network, firewall, and other communication channels necessary to allow communication between ArcGIS and the cloud data warehouse.

Next, the administrator of the cloud data warehouse creates accounts and grants the accounts privileges to access specific tables in the cloud data warehouse. The administrator can create a connection from ArcGIS Pro to the cloud data warehouse and share the connection file with publishers, or the administrator can provide publishers with the credentials necessary to allow them to create their own connection files.

To publish ArcGIS Server web services that reference data in the cloud data warehouse, publishers must register the database connection file with one of the ArcGIS Server sites that are federated with ArcGIS Enterprise. To publish a web service with a snapshot, you must register the database connection file with the ArcGIS GIS Server site that acts as the hosting server.

Install and configure drivers

To publish a map image layer that contains data from Snowflake, you must install and configure the Snowflake 64-bit ODBC driver on each machine in the federated ArcGIS Server site to which you will publish. See Software required to connect to a database or data warehouse for requirements and limitations.

Download the Snowflake ODBC driver from the Snowflake website, and install it on all ArcGIS client machines that will connect to Snowflake. Follow instructions provided by Snowflake to install and configure the driver.

Edit the init_user_param.sh script

If the federated ArcGIS Server sites to which you'll publish run on Linux machines, you must install the drivers on each machine in the GIS Server site and configure the init_user_param.sh script on each machine to access the drivers.

Alter the init_user_param.sh script installed with ArcGIS Server to reference the drivers. You can access this script by browsing to the <ArcGIS Server installation directory>/arcgis/server/usr directory.

  1. Ensure that the ArcGIS Server installation owner on each machine has at least read and execute permissions on the data warehouse client libraries.

  2. Open the init_user_param.sh script in a text editor.

  3. Remove the comment marks (#) from the lines beginning with export. Replace <Location_to_ODBC_driver_manager_libraries> with the location of the ODBC driver manager on the machine, and replace <Location_to_libSnowflake.so> with the location of the Snowflake ODBC driver.

    #
    # Modify this section to configure a connection to Snowflake Data Warehouse
    #
    # -----------------------------------------------------------------------
    export LIB_ODBC_DRIVER_MANAGER=<Location_to_ODBC_driver_manager_libraries>/libodbc.so.2
    export LD_PRELOAD=$LD_PRELOAD:$LIB_ODBC_DRIVER_MANAGER:<Location_to_libSnowflake.so>/libSnowflake.so
    
  4. Save and close the script.

  5. For the changes you made in the init_user_param.sh file to take effect, you must restart ArcGIS Server.

    To do this, run the stopserver.sh script, then run the startserver.sh script on each machine in the ArcGIS Server site.

    ./stopserver.sh

    ./startserver.sh

Create a database connection

You must have a database connection (.sde file) that authenticates the connection to the database. To use the database connection file with ArcGIS Server, you must save user information with the connection file.

You can call the ArcPy CreateDatabaseConnection function from one of the machines in the ArcGIS Server site that needs to connect to the database. See Create Database Connection in the ArcGIS Pro help for information about running this function.

Register the connection file

To allow ArcGIS Server sites to access the data, use the database connection file you created to add a registered data store in ArcGIS Pro or add a data store item in the portal.

To publish with the Create a snapshot for query layers configuration parameter enabled, you must register the database connection file with the hosting server. See the Configure parameters section in the ArcGIS Pro help for more information about this parameter.