Forum Discussion

AmanKumar's avatar
AmanKumar
New Member
1 year ago
Solved

api connection issues from local to fabric notebook

When I am using my local flask api in fabric notebook I am getting this error. from flask import Flask, request, jsonify import openai from openai import AzureOpenAI # Configuration for Az...
  • nilendraFabric's avatar
    1 year ago

    Hi AmanKumar 

     

    A local Flask application cannot be run directly in Microsoft Fabric notebooks.

    This is because Fabric notebooks operate within an isolated network environment, which prevents direct access to local resources or servers like your Flask API.

     

    Microsoft Fabric has security measures in place that prevent connecting to external local services within its environment

     

    Try these:

     

    Adapt Your Code: Rewrite your Flask app logic to work within Fabric’s notebook environment using PySpark and other supported libraries.
    2. External API Deployment: Deploy your Flask app to a cloud service that provides a public URL, then make API calls to it from your Fabric notebook.

     

    please give kudos and accept this solution if this is helpful.

     

    thanks

    Nilendra