0

I am trying to download files from my azure app service using python. I can manually connect to it with Winscp using the FTPS endpoint as hostname (which auto assigns the port to 990 if relevant) and the username and password in the FTSP credentials. The ftplib docs example works for me but I am unsuccessful to connect to my own azure host.

The following attempts result in socket.gaierror: [Errno 11001] getaddrinfo failed:

from ftplib import FTP
ftp = FTP('url as written the app service overview') #attempt 1
ftp = FTP('FTPS endpoint as written in the FTPS credentials in the deployment center') #attempt 2

The following attempts result in TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or.. :

from ftplib import FTP
ftp = FTP('url as written the app service overview without the https://') #attempt 3
ftp = FTP('url as written the app service overview without the https://', assigned port in the Winscp connection) #attempt 4
ftp = FTP('Virtual IP address written in the app service properties) #attempt 5

Any ideas which is the right setting for the host input in FTP(), Or any other solutions?

Kahalon
  • 119
  • 1
  • 12
  • 990 is a port for implicit TLS encryption. For that, see https://stackoverflow.com/q/12164470/850848. – Martin Prikryl Nov 09 '21 at 16:22
  • @MartinPrikryl Thank you, that got me reading and trying the [FTP_TLS](https://docs.python.org/3/library/ftplib.html#ftplib.FTP_TLS) but no difference – Kahalon Nov 09 '21 at 16:40
  • So show us what exactly did you try and how exactly did it fail. – Martin Prikryl Nov 09 '21 at 16:50
  • @MartinPrikryl I used it the same way as I did in my post, instead of FTP() FTP_TLS(). It has another input variable name source_address but I can't understand if it relevant. I only need the one correct line to connect but it hides in so many options.. – Kahalon Nov 09 '21 at 16:57
  • that's not correct way to implement implicit TLS encryption. Please read *carefully* again the link I've posted above. For implicit TLS, there's no "one correct line". It involves much more code. – Martin Prikryl Nov 09 '21 at 17:30
  • @MartinPrikryl I am trying to do it with the link you have posted, and when I use the FTPS endpoint as my host (as I do in Winscp), it returns the Errno 11001. the endpoinst is :'ftps://waws-prod-dxb-003.ftp.azurewebsites.windows.net/site/wwwroot'. It feels like it does not accept its format. Any Ideas? Thanks for the help so far! – Kahalon Nov 09 '21 at 17:56
  • There's no `ftps://` in any if the answers to the linked question. Just use some of the code from the answers. I'd suggest the answer by @tandztc or @prossblad. – Martin Prikryl Nov 09 '21 at 18:10

0 Answers0