Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
When I am using my local flask api in fabric notebook I am getting this error.
ConnectionError: HTTPSConnectionPool(host='127.0.0.1', port=5000): Max retries exceeded with url: /get_expiry (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7bbf00902110>: Failed to establish a new connection: [Errno 111] Connection refused'))
Solved! Go to Solution.
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
Hi @AmanKumar ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @AmanKumar ,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Hi @AmanKumar ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Regards,
Menaka.
Hi @AmanKumar ,
Thank you for reaching out to us on the Microsoft Fabric Community Forum.
As @nilendraFabric mentioned,a local Flask application cannot be directly accessed from a Microsoft Fabric notebook.
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
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 |
---|---|
9 | |
5 | |
4 | |
3 | |
2 |
User | Count |
---|---|
6 | |
4 | |
3 | |
3 | |
3 |