Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Fabric Community,
I am working with data pipelines, where I need to retrive cloud connection details using python. These connection can be easily viewed from Setting -> Manage Connection and Gateways
Below this we can view our connections.
Is there any way by which i can get the details like connection ID, connection String, etc
If you need to find the gateway ID specifically, you can use the Datasets - Get Datasources In Group REST API endpoint. You’ll need your workspace /group and dataset ID, and you’ll get back the details of the dataset’s datasource.
Solved: ID Gateway and datasource - Microsoft Fabric Community
Datasets - Get Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Any way by which we can grab them ??
If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com
Thank you very much lbendlin for your prompt reply.
The REST API is a good way to do this. Most cloud services provide REST apis to manage connections and gateways. You can use these apis to get the details you need.
You can also use the requests library in Python to make API calls.
First, you need to install the requests library.
You can install it using the pip command. Open your command line terminal. Enter the following command and press Enter.
Here’s a basic example:
import requests
# Replace with your API endpoint and necessary headers
api_url = "https://api.yourcloudservice.com/connections"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.get(api_url, headers=headers)
if response.status_code == 200:
connections = response.json()
for connection in connections:
print(f"ID: {connection['id']}, Connection String: {connection['connectionString']}")
else:
print(f"Failed to retrieve connections: {response.status_code}")
You can view the link below for more details:
Requests: HTTP for Humans™ — Requests 2.32.3 documentation (python-requests.org)
Python's Requests Library (Guide) – Real Python
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Run the standard REST API calls from Python
Gateways - Get Datasources - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Thanks @lbendlin, for posting your answer. For me, I am not able to view the gateway / gateway ID. Can you please help me to find gateway. Also to mention I am not using any on-prem connections.
attaching image for your reference
There is no gateway. These are leftovers from your local experimentations.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Fabric update to learn about new features.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |