Ready to get started?

Learn more about CData Connect Cloud or sign up for free trial access:

Free Trial

Connect to Zuora Data as an External Data Source using PolyBase



Use CData Connect Cloud and PolyBase to create an external data source in SQL Swerver with access to live Zuora data.

PolyBase for SQL Server allows you to query external data by using the same Transact-SQL syntax used to query a database table. When paired with the CData ODBC Driver for Zuora, you get access to your Zuora data directly alongside your SQL Server data. This article describes creating an external data source and external tables to grant access to live Zuora data using T-SQL queries.

NOTE: PolyBase is only available on SQL Server 19 and above, and only for Standard SQL Server.

CData Connect Cloud provides a pure SQL Server interface for Zuora, allowing you to query data from Zuora without replicating the data to a natively supported database. Using optimized data processing out of the box, CData Connect Cloud pushes all supported SQL operations (filters, JOINs, etc.) directly to Zuora, leveraging server-side processing to return the requested Zuora data quickly.

Configure Zuora Connectivity for PolyBase

Connectivity to Zuora from PolyBase is made possible through CData Connect Cloud. To work with Zuora data from PolyBase, we start by creating and configuring a Zuora connection.

  1. Log into Connect Cloud, click Connections and click Add Connection
  2. Select "Zuora" from the Add Connection panel
  3. Enter the necessary authentication properties to connect to Zuora.

    Zuora uses the OAuth standard to authenticate users. See the online Help documentation for a full OAuth authentication guide.

    Configuring Tenant property

    In order to create a valid connection with the provider you need to choose one of the Tenant values (USProduction by default) which matches your account configuration. The following is a list with the available options:

    • USProduction: Requests sent to https://rest.zuora.com.
    • USAPISandbox: Requests sent to https://rest.apisandbox.zuora.com"
    • USPerformanceTest: Requests sent to https://rest.pt1.zuora.com"
    • EUProduction: Requests sent to https://rest.eu.zuora.com"
    • EUSandbox: Requests sent to https://rest.sandbox.eu.zuora.com"

    Selecting a Zuora Service

    Two Zuora services are available: Data Query and AQuA API. By default ZuoraService is set to AQuADataExport.

    DataQuery

    The Data Query feature enables you to export data from your Zuora tenant by performing asynchronous, read-only SQL queries. We recommend to use this service for quick lightweight SQL queries.

    Limitations
    • The maximum number of input records per table after filters have been applied: 1,000,000
    • The maximum number of output records: 100,000
    • The maximum number of simultaneous queries submitted for execution per tenant: 5
    • The maximum number of queued queries submitted for execution after reaching the limitation of simultaneous queries per tenant: 10
    • The maximum processing time for each query in hours: 1
    • The maximum size of memory allocated to each query in GB: 2
    • The maximum number of indices when using Index Join, in other words, the maximum number of records being returned by the left table based on the unique value used in the WHERE clause when using Index Join: 20,000

    AQuADataExport

    AQuA API export is designed to export all the records for all the objects ( tables ). AQuA query jobs have the following limitations:

    Limitations
    • If a query in an AQuA job is executed longer than 8 hours, this job will be killed automatically.
    • The killed AQuA job can be retried three times before returned as failed.
  4. Click Create & Test
  5. Navigate to the Permissions tab in the Add Zuora Connection page and update the User-based permissions.

Add a Personal Access Token

If you are connecting from a service, application, platform, or framework that does not support OAuth authentication, you can create a Personal Access Token (PAT) to use for authentication. Best practices would dictate that you create a separate PAT for each service, to maintain granularity of access.

  1. Click on your username at the top right of the Connect Cloud app and click User Profile.
  2. On the User Profile page, scroll down to the Personal Access Tokens section and click Create PAT.
  3. Give your PAT a name and click Create.
  4. The personal access token is only visible at creation, so be sure to copy it and store it securely for future use.

Create an External Data Source for Zuora Data

After configuring the connection, you need to create a credential database for the external data source.

Creating a Credential Database

Execute the following SQL command to create credentials for the external data source connected to Zuora data.

NOTE: Set IDENTITY to your Connect Cloud username and set SECRET to your Personal Access Token.


CREATE DATABASE SCOPED CREDENTIAL ConnectCloudCredentials
WITH IDENTITY = 'yourusername', SECRET = 'yourPAT';

Create an External Data Source for Zuora

Execute a CREATE EXTERNAL DATA SOURCE SQL command to create an external data source for Zuora with PolyBase:


CREATE EXTERNAL DATA SOURCE ConnectCloudInstance
WITH ( 
  LOCATION = 'sqlserver://tds.cdata.com:14333',
  PUSHDOWN = ON,
  CREDENTIAL = ConnectCloudCredentials
);

Create External Tables for Zuora

After creating the external data source, use CREATE EXTERNAL TABLE statements to link to Zuora data from your SQL Server instance. The table column definitions must match those exposed by CData Connect Cloud. You can use the Data Explorer in Connect Cloud to see the table definition.

Sample CREATE TABLE Statement

Execute a CREATE EXTERNAL TABLE SQL command to create the external table(s), using the collation and setting the LOCATION to three-part notation for the connection, catalog, and table. The statement to create an external table based on a Zuora Invoices would look similar to the following.

CREATE EXTERNAL TABLE Invoices(
  Id COLLATE [nvarchar](255) NULL,
  BillingCity COLLATE [nvarchar](255) NULL,
  ...
) WITH ( 
  LOCATION='Zuora1.Zuora.Invoices',
  DATA_SOURCE=ConnectCloudInstance
);

Having created external tables for Zuora in your SQL Server instance, you are now able to query local and remote data simultaneously. To get live data access to 100+ SaaS, Big Data, and NoSQL sources directly from your SQL Server database, try CData Connect Cloud today!