Edit

Share via


Data source management

Microsoft Fabric works with many data sources, both on-premises and in the cloud. Each data source has specific setup requirements. This article shows you how to add an Azure SQL Server as a cloud data source as an example - and the process is similar for other sources. If you need help with on-premises data sources, see Add or remove a gateway data source.

Note

Right now, cloud connections work with data pipelines and Kusto. For datasets, datamarts, and dataflows, you need to use Power Query Online's "get data" experience to create personal cloud connections.

Add a data source

Here's how to add a new data source:

  1. Open the Microsoft Fabric service and select the Settings icon in the header. Then select Manage connections and gateways.

    Screenshot showing where to select Manage connections and gateways.

  2. On the Connections tab, select New at the top of the screen.

  3. In the New connection screen:

    • Select Cloud
    • Enter a descriptive Connection name
    • Choose your Connection Type (we use SQL server in this example)
  4. Fill in the data source details. For SQL server, you need:

    • Server name
    • Database name

    Screenshot showing examples of details in New connection screen.

  5. Choose your Authentication method:

    • Basic
    • OAuth2
    • Service Principal

    Screenshot showing where to select an authentication method.

    Note

    If you use OAuth2:

    • Long-running queries might fail if they exceed the OAuth token expiration
    • Cross-tenant Microsoft Entra accounts aren't supported
  6. Optional: Set up a privacy level under General > Privacy level. This setting doesn't affect DirectQuery connections.

    Screenshot showing privacy level options.

  7. Select Create. You see a Created new connection message under Settings when successful.

    Screenshot of new connection success message.

Once created, you can use this data source to work with Azure SQL data in supported Microsoft Fabric items.

Allow cloud connection usage on gateway

When creating a connection, you see a setting labeled This connection can be used with on-premise data gateways and VNet data gateways. This setting controls whether your connection can work with gateways:

  • When unchecked: The connection can't be used with gateway-based evaluations
  • When checked: The connection can work with gateway-based evaluations

Caution

While this setting appears when creating cloud connections through Dataflow Gen2, it isn't currently enforced. All shareable cloud connections work through a gateway if one is present.

Remove a data source

To remove a data source that's no longer needed, follow these steps:

  1. Go to the Data screen in Manage connections and gateways
  2. Select your data source
  3. Select Remove from the top ribbon

Important

When you remove a data source, any items that depend on it stop working.

Screenshot of where to select Remove.

Get a data source connection ID

To retrieve a connection ID for use in Microsoft Fabric items or REST APIs, use one of these methods:

Use the service interface

  1. Go to Manage connections and gateways

    Screenshot of where to select Settings.

  2. Under the connection Settings screen, copy the connection ID of the data source.

    Screenshot of retrieving connection ID from the connection settings.

Use the REST API

Use the List Connections endpoint to retrieve your connection information:

  1. Send an HTTP GET to the Fabric Connections API, including your token in the Authorization header:

    curl -X GET https://api.fabric.microsoft.com/v1/connections \
    -H "Authorization: Bearer $ACCESS_TOKEN"
    
  2. A successful response returns a JSON payload similar to:

     {
     "value": [
        {
           "id": "bbbbbbbb-1111-2222-3333-cccccccccccc",
           "displayName": "ContosoConnection1",
           …
        },
        {
           "id": "cccccccc-2222-3333-4444-dddddddddddd",
           "displayName": "ContosoConnection2",
           …
        }
     ],
     "continuationToken": "…",
     "continuationUri": "…"
     }
    
  3. Each object’s id property under the value array is the connection ID. Extract the id property from the response as needed.

    Note

    If you have more than 100 connections, use the continuationToken query parameter on subsequent requests to page through all results.

Here's a sample Python snippet that uses requests and Microsoft Authentication Library (msal) to call the GET /v1/connections endpoint and parse connection IDs:

import requests
import msal

# 1. Acquire token
app = msal.ConfidentialClientApplication(
   client_id="YOUR_CLIENT_ID",
   client_credential="YOUR_CLIENT_SECRET",
   authority="https://login.microsoftonline.com/YOUR_TENANT_ID"
)
result = app.acquire_token_for_client(scopes=["https://api.fabric.microsoft.com/.default"])
token = result["access_token"]

# 2. Call API
headers = {"Authorization": f"Bearer {token}"}
resp = requests.get("https://api.fabric.microsoft.com/v1/connections", headers=headers)
resp.raise_for_status()

# 3. Parse IDs
for conn in resp.json().get("value", []):
   print(f"{conn['displayName']}: {conn['id']}")

Manage users

After you add a cloud data source, you give users and security groups access to the specific data source. The access list for the data source controls only who is allowed to use the data source in items that include data from the data source.

Note

Sharing connections with other users risks unauthorized changes and potential data loss. Users with access to the data source can write to the data source, and connect, based on either the stored credentials or SSO you selected while creating a data source. Before you share a data source connection, always ensure the user or group account you’re sharing are trusted and has only the privileges it needs (ideally a service account with narrowly scoped rights).

Add users to a data source

  1. Select the Settings icon, and open Manage connections and gateways

  2. Find your data source in the list. Use the filter or search in the top ribbon to locate cloud connections quickly.

    Screenshot showing where to find all cloud connections.

  3. Select Manage users from the top ribbon

  4. In the Manage users screen:

    • Add users or security groups from your organization
    • Select the new user name
    • Choose their role: User, User with resharing, or Owner
  5. Select Share to give them access

    Screenshot showing the Manage users screen.

Note

You need to add users to each data source separately - each one has its own access list.

Remove users from a data source

To remove access, go to the Manage Users tab and remove the user or security group from the list.

Manage sharing permissions

Control who can share connections in your organization. By default, users can share connections if they are:

  • Connection owners or admins
  • Users with sharing permissions

Connection sharing helps teams collaborate while keeping credentials secure. Shared connections only work within Fabric.

Restrict connection sharing

As a tenant admin, you can limit who can share connections:

  1. You need Power BI Service Administrator privileges

  2. Open Power BI or Fabric settings and go to Manage connections and gateways

  3. Turn on the tenant administration toggle in the top right

    Screenshot showing the tenant administration toggle in the Manage connections and gateways page.

  4. Select Blocking shareable cloud connections and turn it on.

    • When off (default): Any user can share connections
    • When on: Sharing is blocked tenant-wide

    Screenshot showing the manage cloud connection sharing feature.

  5. Optional: Add specific users to an allowlist:

    • Search for users and select Add
    • Listed users can still share connections
    • Everyone else is blocked from sharing

    Screenshot showing the manage cloud connection sharing feature toggled on.

Note

  • Blocking sharing could limit collaboration between users
  • Existing shared connections stay shared when you turn on the restriction