I need to deploy a Azure Worker Role with input endpoint on port 21 so that it can accepts incoming FTP connections.so that i should be able to connect to worker role through FTP Client like Filezilla and access the azure blob storage.
for this i was able to implement FTP commands like LIST,RETR,STOR,PORT,USER and PASS.All these works fine with Active mode of FTP.
But when i switch to PASSIVE mode of FTP(execute PASV command to Azure Worker Role),I am finding the issue.Since i am newbie to Azure so not able to trace the problem..Going through few blogs got to know that since Azure Worker role are beyond the Load balancer so PASSIVE mode need configuration.I saw few blogs which talks about manual configuration of Web role for FTP..Since i am working on worker role, does configuration change and how can handle it in code and more over since we are not sure about which vm machine the role gonna deployed..how can i handle configuration
Ways i tried:
1.In the Azure Worker role,i set the following end points
FTP Input tcp 21
Endpoint1 Input tcp 1025
initially on Start(),I had this code on line
TcpListener server = SocketHelpers.CreateTcpListener(RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["FTP"].IPEndpoint);
and on PASV mode i had following
TcpListener server = SocketHelpers.CreateTcpListener(RoleEnvironment.CurrentRoleInstance.InstanceEndpoints[" Endpoint1"].IPEndpoint); so that it opens on new port 1025 and send back to the client.while sending back to client i got exception as follows:
SocketErrorCode is 10053 and SocketErrorDesc:System.Net.Sockets.SocketError.ConnectionAborthhed
Unable to write data to the transport connection: An established connection was aborted by the software in your host machine.
2.other way by getting external IP address using http://checkip.dyndns.org/,if i get IPadress from this,do i need to get the port from code using RoleEnvironment.CurrentRoleInstance.InstanceEndpoints[" Endpoint1"].IPEndpoint???
Really I am really confused with Azure stuff and FTP configuration.
I went through following articles but could not find how to configure programmatically worker role (setting the port range,retrieving from the code) to work on PASSIVE mode.
http://www.itq.nl/blogs/post/Walkthrough-Hosting-FTP-on-IIS-75-in-Windows-Azure-VM.aspx http://angelolaris.blogspot.com/
Regards, Vivek