Python Microsoft Fabric - Letting Fabric pipelines read your local systems

One HTTPS endpoint that notebooks and pipelines read from, with no data gateway.

This page turns the direction around - a Fabric notebook or pipeline reads a database in your own network through a REST channel that a Zato service publishes over HTTPS. Fabric reads the URL like any other API.

The on-premise gateway page explains the pattern for every cloud service, and this one walks through it for Fabric.

The service

A SQL connection to the local database is created in the Dashboard once. The service takes a since time, so a caller reads what changed rather than everything, and declares its output, so the channel returns these four columns.

# -*- coding: utf-8 -*-

# Zato
from zato.server.service import Service

class GetAppointments(Service):

    name = 'appointments.get'
    input = 'since'
    output = 'appointment_id', 'location', 'starts_at', 'status'

    def handle(self):

        conn = self.out.sql['Appointments DB']

        query = """
        select appointment_id, location, starts_at, status
        from appointments
        where updated_at >= :since
        order by starts_at
        """

        params = {'since': self.request.input.since}
        result = conn.execute(query, params)

        self.response.payload = result

The channel

Under Connections → REST → Channels, create the channel at /api/appointments with an API key. In enmasse YAML:

security:
  - name: Fabric Reader Key
    type: apikey
    username: fabric-reader
    password: Zato_Enmasse_Env.FabricReaderKey

channel_rest:
  - name: api.appointments
    service: appointments.get
    url_path: /api/appointments
    security: Fabric Reader Key
    data_format: json

Any caller with the key reads the rows over HTTPS:

curl -H "X-API-Key: <the key>" "https://api.example.com/api/appointments?since=2026-03-11T00:00:00Z"
[
  {"appointment_id": "APT-2205", "location": "Riverside",   "starts_at": "2026-03-11T13:00:00Z", "status": "Scheduled"},
  {"appointment_id": "APT-2206", "location": "Oak Hill",    "starts_at": "2026-03-11T13:30:00Z", "status": "Checked in"},
  {"appointment_id": "APT-2207", "location": "Maple Grove", "starts_at": "2026-03-11T14:00:00Z", "status": "Cancelled"},
  {"appointment_id": "APT-2208", "location": "Riverside",   "starts_at": "2026-03-11T15:00:00Z", "status": "Scheduled"}
]

From a notebook

A notebook reads the endpoint like any HTTPS API and the rows go straight into a DataFrame:

# In a Microsoft Fabric notebook
import requests

url = 'https://api.example.com/api/appointments'
headers = {'X-API-Key': '<the key>'}
params = {'since': '2026-03-11T00:00:00Z'}

response = requests.get(url, headers=headers, params=params)
appointments = response.json()

frame = spark.createDataFrame(appointments)
display(frame)

From a pipeline

A pipeline does the same without code. Add a Copy activity, choose REST as the source with the channel's URL and the X-API-Key header, and the lakehouse as the destination with appointments as the table. Each run reads the endpoint and writes what it got into the table.

After the run, the table in the lakehouse holds the same four rows the endpoint returned:

See also

PageWhat it covers
On-premise gatewayThe pattern for every cloud caller, with Power Automate and Azure
Picking up results when a notebook finishesA pipeline calling a REST channel to say it is done
Loading data into tablesThe other direction, a service pushing rows into Fabric

Learn more