Can I use the FTP protocol (through a hybrid connection) to copy files from an Azure File share to an Azure virtual machine?
I am attempting to find some means for an Azure Function to copy a file to an Azure Virtual Machine. Copying a file using SMB to a non-Azure storage source (not Azure File Shares or Blobs) is not possible due the the Azure app sandbox. https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#file-system-restrictionsconsiderations
So I have attempted to use FTP over a Hybrid Connection for port 21. I thought this would work. FTP/SFTP/FTPS are socket based (like SQL Server). That is what hybrid connections are to provide. A means for socket based communication without opening your firewall.
This works locally off my desktop. This does not work in Azure. I get the following error and there appears to not be a dang thing I can do to correct it.
Should this work?
Thanks
The server committed a protocol violation at System.Net.FtpWebRequest.SyncRequestCallback(Object obj)
at System.Net.CommandStream.InvokeRequestCallback(Object obj)
at System.Net.CommandStream.Abort(Exception e)
at System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage)
at System.Net.FtpWebRequest.GetResponse()
at ProcessSalesforceData.Manager.Repositories.FtpStorageRepository.CopyAsync(String sourcePathAndFile, String destinationPathAndFile, String fileShare) in D:\a\8\s\Production\Services\ProcessSalesforceData\trunk\ProcessSalesforceData.Manager\Repositories\FtpStorageRepository.cs:line 56
at ProcessSalesforceData.Manager.FileStorageManager.CopyAsync(QueueRequest queueRequest, ProjectInformation projectInfo) in D:\a\8\s\Production\Services\ProcessSalesforceData\trunk\ProcessSalesforceData.Manager\FileStorageManager.cs:line 41
at ProcessSalesforceData.Manager.ProcessRequestManager.ProcessRequestAsync(QueueRequest queueRequest) in D:\a\8\s\Production\Services\ProcessSalesforceData\trunk\ProcessSalesforceData.Manager\ProcessRequestManager.cs:line 54
This is a certificate problem (for which I have no control over): RemoteCertificateNameMismatch, I respond with true. This works locally but not as an Azure Function. Maybe we are just not ready to move to the cloud.