2

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

Vivek Misra
  • 265
  • 4
  • 13

1 Answers1

0

First think i could confirm is that, ot sure if you are also starting the listener as below or now:

TcpListener myPortListener = new TcpListener(RoleEnvironment.CurrentRoleInstance.InstanceEndpoints["MY_PORT"].IPEndpoint);
myPortListener.Start();

Next when you have above code in your worker role the Port start to take incoming request and any application which has binding to IP/Port will receive the packets.

IF you really want to understand it how to get it working in your Worker Role, what you can do is, following this guidance to setup in a Web Role first and then try to replicate same configuration in your worker role. It is little complex to do but first you would need to understand how things work and then you would be able to implement itself.

Also your requirement is not clear because I am not sure why do you need such configuration because you can connect directly to Azure Blob storage (if your data is located at Azure Blob storage) from a Worker Role and access the content, why having FTP/local connectivity to make it complex. May be if you revisit your application architecture, you don't need to do such work.

AvkashChauhan
  • 20,495
  • 3
  • 34
  • 65
  • Thanks for your answer.I will go through the link you have provided and get back to you.My only concern is since we do not have IIS in worker role,how can i handle the configuration mentioned in the above link.ANyways let me go through it once.Thanks again. – Vivek Misra Aug 30 '12 at 18:01
  • for learning process you can use webrole ( a webrole is just a worker role with IIS) and use the learning to implement same thing in a worker role without IIS. – AvkashChauhan Aug 30 '12 at 18:39