Accessing python application hosted on Azure VM (Windows OS) from outside

2019-02-01T17:46:21

I have hosted a python flask web application on azure virtual machine (Windows OS). When I start the python application, it gets hosted on 127.0.01:5000 i.e. localhost. I can access this in browser by providing localhost:5000 in URL. I want to access this from outside the VM machine. The problem here is Azure VMs have an internal IP and external IP.

I tried to use the external VM IP as parameter in app.run() but it throwing error and not able to host it on external IP.

app.run(HOST = “external Azure VM  IP”)

It is throwing below error when trying to host on external IP.

"Error : s.bind(get_sockaddr(hostname, port, address_family)) OSError: [WinError 10049] The requested address is not valid in its context"

Is there any way I can make it work?

Also, I tried hosting it on azure web app services and I was successfully able to host there but I am not able to install external libraries like (beautifulsoup4) into flask application hosted on Azure App Services.

Copyright License:
Author:「Devesh Tiwari」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/54476819/accessing-python-application-hosted-on-azure-vm-windows-os-from-outside

About “Accessing python application hosted on Azure VM (Windows OS) from outside” questions

I have hosted a python flask web application on azure virtual machine (Windows OS). When I start the python application, it gets hosted on 127.0.01:5000 i.e. localhost. I can access this in browser...
I have created a docker container in Azure on Windows 2016. Here is my DOCKERFILE: FROM microsoft/aspnet COPY ./ /inetpub/wwwroot EXPOSE 443 EXPOSE 80 I run it up like so: docker run -d --name
I am using an Azure DevOps pipeline that is basically a series of steps that call PowerShell scripts that take in parameter values and within the PS script the "Az module commands" are ca...
I have created ASP.net vNext application in Visual Studio 2015. I have used Docker tools for VS 2015. Created the Windows Server 2016 VM and published my asp.net vnext application inside a containe...
I configured SonarQube on Azure VM (Windows). Everything working as expected. Only thing is I can not access SonarQube portal outside my Azure VM. I whitelisted port in firewall as well as subnet N...
I have to create a alert on a application which is hosted on Azure VM configured which is accessed via Azure gateway. Whenever application goes down ( any response code other than 200) have to send...
I have 2 azure VMs 1st is Linux machine(ubuntu 18.04) and 2nd is windows azure vm. I have MySql database in Linux machine. I want to move the data from Linux MySql database to SQL Server Database w...
I have installed an application(QLik Nprinting) in a new Azure virtual machine. The application has a web portal that can be launched using URL http://servername:4994/. I can access this web portal
We have developed an application using DJango 1.3.1, Python 2.7.2 using Database as SQL server 2008. All these are hosted in Win 2008 R2 operating system on VM. The clients has windows 7 as o/s. ...
I have a website hosted in IIS on an Azure Windows Server VM (Datacenter 2019). I can telnet to port 80 on the VM (and as you'd expect this stops working if I try disabling the relevant Windows Fir...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.