Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flask web app on Azure help
#1
I created a simple app that has a client part that accesses (uses requests library) another app (web app) using Flask library to get data. Everything works when I run it locally. I am trying to put the web app portion on a VM in Azure and then access it from the client on my local machine. I added an inbound port rule on the Azure VM to open port 5000. I then updated the client app to use the public IP address of the Azure VM and it uses port 5000. I run the web app and then tried running the client with both HTTP and HTTPS in my Get request:

getproduct = requests.get("https://13.66.191.67:5000/products")

I get this error:
requests.exceptions.ConnectionError: HTTPConnectionPool(host='13.66.191.66', port=5000): Max retries exceeded with url: /products (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x0000009DF56639D0>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

Any ideas on what I should check next?
Reply
#2
I spent all day but I figured it out. It was the firewall on the VM itself blocking port 5000.
Reply
#3
Yes this solution work, but it would be more correct place nginx in front of flask.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python Desktop Application that will connect o Azure SQL Database thewolf 7 4,551 Feb-26-2021, 01:33 AM
Last Post: thewolf
  Azure Function App Configuration Settings jdb1234 1 2,146 Oct-16-2020, 10:54 AM
Last Post: ndc85430
  Can not point to Selenium Webdriver path for Python Jupyter Notebook on Azure dadadance 4 10,080 Jul-31-2019, 10:00 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020