The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello Everyone,
I would like to know how can i get access in this endpoint cause when i try to connect i get a message error about Timeout ..
Hi, @mtoarantes
Thank you for your detailed response. Based on my search, I personally recommend using the service principal method to call the following types of REST APIs, as this is our preferred approach.
POST https://api.fabric.microsoft.com/v1/workspaces/{workspaceId}/items
Items - REST API (Core) | Microsoft Learn
Below are screenshots and links related to issues with similar port calls:
For more details, please refer to:
Solved: Power BI API - return unexpexted result - Microsoft Fabric Community
Solved: Re: Is there anyone familiar with: https://wabi-us... - Microsoft Fabric Community
Solved: Getting Token for API Dataflow Gateway Binding - Microsoft Fabric Community
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
def crear_sesion():
"""Crea una sesión de requests con reintentos"""
sesion = requests.Session()
reintentos = Retry(total=3, backoff_factor=5, status_forcelist=[502, 503, 504])
adaptador = HTTPAdapter(max_retries=reintentos)
sesion.mount('http://', adaptador)
sesion.mount('https://', adaptador)
return sesion
SESION = crear_sesion()
def invocar_api_fabric(metodo, uri, params=None, payload=None):
"""Invoca la API de Fabric y maneja la paginación si es necesario"""
token = obtener_token()
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
todos_los_datos = []
token_continuacion = None
try:
while True:
if token_continuacion:
params['continuationToken'] = token_continuacion
url = f"https://{API_ENDPOINT}/{uri}"
respuesta = SESION.request(metodo, url, headers=headers, params=params, json=payload, timeout=800)
respuesta.raise_for_status()
datos_respuesta = respuesta.json()
if isinstance(datos_respuesta, list):
todos_los_datos.extend(datos_respuesta)
else:
todos_los_datos.extend(datos_respuesta.get('value', []))
token_continuacion = datos_respuesta.get('continuationToken')
if not token_continuacion:
break
return todos_los_datos
Hello @Anonymous ,
Thank you for the answer, bellow im putting the code about the API
Hi, @mtoarantes
Thanks for reaching out to the Microsoft fabric community forum.
Are you encountering errors when connecting to the Lakehouse via the SQL Analytics endpoint? If so, this might be related to the large volume of data causing M language query processing to time out. You can resolve this issue by setting the CommandTimeout. Here are some relevant answers that might help you:
For more details, please refer to:
Solved: How to set command timeout option - Microsoft Fabric Community
If the error occurs during an API call, please check if the API you are using supports Long Running Operations. Here are some relevant document screenshots:
For more details, please refer to:
Long running operations - Microsoft Fabric REST APIs | Microsoft Learn
Items - Create Item - REST API (Core) | Microsoft Learn
Solved: Re: Not able to connect to Lakehouse SQL endpoint - Microsoft Fabric Community
If the issue is with an API call, please share which API call is causing the problem and provide more error details.Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.