I'm looking for a straightforward and reliable method to access an on-premises network share from a time-triggered Azure Function in .NET. The goal is to fetch files from a specific subfolder on the server, process them, and move some to a backup location, while ensuring that additions and deletions are in sync between the Azure Function and the network share. Previously, a quick solution with logic apps and an on-premises data gateway was used, but it couldn't handle files larger than 20 MB. Now the customer wants to transition to an Azure Function but I've run into issues with network access since Azure apps have sandbox restrictions and SMB protocol is blocked. I've explored Azure File Shares and Azure File Sync but I'm unsure about the best approach. Can anyone share their experiences or advice on a reliable way to tackle this?
2 Answers
Yes, you can definitely mount Azure Files as a disk. It can work well for integrating with your on-prem setup, allowing easier access to the files you need.
If you've got a site-to-site VPN and proper routing, combined with VNET integration for your Function App, it could work! Just make sure the on-prem server's name is resolvable from your VNET, possibly using a private DNS resolver. Also, you'll need a local account (not AD) to authenticate with the SMB server.
I tried this approach but ran into an access error. I suspect the VNET setup wasn't correct. However, other functions accessing services like SQL and FTP on the same VNET work fine. I found a Kudu article that suggests that certain ports required for SMB are often blocked in the sandboxes, so I’m wondering if moving to a Linux environment might help, but I’m not sure about SMB compatibility there.