Configure authentication to Xero

Important

This feature is in Beta. To use it, a workspace admin must turn on Lakeflow Connect for Xero from the Previews page. See Manage Azure Databricks previews.

To let the Lakeflow Connect Xero connector authenticate, create a web app in the Xero Developer portal and note the tenant ID of the organization to ingest. Use the credentials retrieved from the steps on this page to create a Unity Catalog connection in Azure Databricks.

Prerequisites

  • A Xero organization on a trial or paid Xero subscription. To test the connector, use the Xero Demo Company. See Getting started.
  • A Xero Developer account, which is free. Your app's developer pricing tier sets how many organizations the app can connect to and its daily API call limit.
  • The user who authorizes the connection must have Standard, Adviser, or Administrator access to the organization with the Connected Apps permission. See Permissions.
  • To ingest the projects table, the organization must add Xero Projects to its subscription, and the authorizing user must have a Xero Projects user role. See Manage your Xero Projects subscription and the Projects API overview.
  • Your Azure Databricks workspace domain, to set the app's redirect URI.

Configure Xero

The Xero connector authenticates with OAuth user-to-machine (U2M) authorization through a Xero web app. In this step, create an app, register the Azure Databricks redirect URI, and note the credentials that you enter on the connection page. For more information, see the Xero OAuth 2.0 overview.

  1. Sign in to the Xero Developer portal and click My Apps.
  2. Click New app.
  3. In the Add a new Xero app dialog, enter an App name and select Web app as the Integration type.
  4. Answer the questions about AI model training and Xero's minimum security requirements.
  5. For Company or application URL, enter your company URL.
  6. For OAuth 2.0 redirect URI, enter https://<your-databricks-workspace-domain>/login/oauth/http.html.
  7. Select the checkbox to agree to the Xero Developer Platform Terms & Conditions, then click Create app.
  8. In the app, click the Configuration tab, then click Generate a secret. Xero shows the secret only one time.
  9. Note the Client id and the client secret. Use these credentials to create a Unity Catalog connection in Azure Databricks.

The connector requests a fixed set of read-only scopes when you sign in, so the app needs no scope configuration. For the list, see Required OAuth permissions.

Find the tenant ID

Each pipeline ingests one Xero organization, which its required tenant_id option names. Xero identifies each organization that an app connects to with a tenant ID. See Tenants.

  1. Call GET https://api.xero.com/connections with an access token that is authorized for the organization. The request needs no Xero-Tenant-Id header. For example, open the Xero API Explorer, click Connect your Xero organisation, select the organization, and run the request.
  2. The response lists one entry for each connected tenant. Find the entry whose tenantName matches your organization, and note its tenantId value. Use tenantId, not id, which identifies the connection.

Next steps

Create a Xero connection in Azure Databricks. See Create a Xero connection.