Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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:
Open the Microsoft Fabric service and select the Settings icon in the header. Then select Manage connections and gateways.
On the Connections tab, select New at the top of the screen.
In the New connection screen:
- Select Cloud
- Enter a descriptive Connection name
- Choose your Connection Type (we use SQL server in this example)
Fill in the data source details. For SQL server, you need:
- Server name
- Database name
Choose your Authentication method:
- Basic
- OAuth2
- Service Principal
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
Optional: Set up a privacy level under General > Privacy level. This setting doesn't affect DirectQuery connections.
Select Create. You see a Created new connection message under Settings when successful.
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:
- Go to the Data screen in Manage connections and gateways
- Select your data source
- Select Remove from the top ribbon
Important
When you remove a data source, any items that depend on it stop working.
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
Go to Manage connections and gateways
Under the connection Settings screen, copy the connection ID of the data source.
Use the REST API
Use the List Connections endpoint to retrieve your connection information:
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"
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": "…" }
Each object’s
id
property under thevalue
array is the connection ID. Extract theid
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
Select the Settings icon, and open Manage connections and gateways
Find your data source in the list. Use the filter or search in the top ribbon to locate cloud connections quickly.
Select Manage users from the top ribbon
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
Select Share to give them access
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:
You need Power BI Service Administrator privileges
Open Power BI or Fabric settings and go to Manage connections and gateways
Turn on the tenant administration toggle in the top right
Select Blocking shareable cloud connections and turn it on.
- When off (default): Any user can share connections
- When on: Sharing is blocked tenant-wide
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
Note
- Blocking sharing could limit collaboration between users
- Existing shared connections stay shared when you turn on the restriction