Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
chetanhiwale
Helper III
Helper III

Get Cloud Connection details in fabric using python

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 

 

chetanhiwale_0-1725868455245.png

Below this we can view our connections. 
Is there any way by which i can get the details like connection ID, connection String, etc

8 REPLIES 8
Anonymous
Not applicable

Hi @chetanhiwale 

 

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.

 

chetanhiwale
Helper III
Helper III

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

Anonymous
Not applicable

Hi @chetanhiwale

 

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. 

lbendlin
Super User
Super User

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. 

Screenshot 2024-09-10 142316.png

attaching image for your reference

There is no gateway. These are leftovers from your local experimentations.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.