your question seems to have elements similar to this question on accessing on premise file shares from an Azure Function App. @ajkuma 's answer there indicates that the Sandbox environment restricts outgoing SMB ports.
In a similar question and answer @ChaitanyaNaykodi-MSFT suggests using a logic app to handle interactions with the file share and connecting the logic app to the function app. The extra logic app may not be the most elegant solution, but it will be an effective and supported means to get the results you need .