【问题标题】:azure function cannot access to on-premise networkazure 功能无法访问本地网络
【发布时间】:2021-04-12 16:16:58
【问题描述】:

我有一个 azure 触发器功能,我希望该服务从本地文件夹中获取文件,然后处理它们。该文件夹是我们只能通过VPN访问的。该服务对此具有 VNET 配置,但仍无法访问该文件夹。

我该怎么办?

请告诉我为什么会收到此错误,或者我是否需要更改流程中的某些内容?提前致谢。

试图ping文件夹地址,得到这个异常

System.Net.NetworkInformation.PingException: An exception occurred during a Ping request. ---> System.ComponentModel.Win32Exception (5): Access is denied. at System.Net.NetworkInformation.Ping.InitialiseIcmpHandle() at System.Net.NetworkInformation.Ping.DoSendPingCore(IPAddress address, Byte[] buffer, Int32 timeout, PingOptions options, Boolean isAsync) at System.Net.NetworkInformation.Ping.Send(IPAddress address, Int32 timeout, Byte[] buffer, PingOptions options) --- End of inner exception stack trace --- at System.Net.NetworkInformation.Ping.Send(IPAddress address, Int32 timeout, Byte[] buffer, PingOptions options) at System.Net.NetworkInformation.Ping.Send(String hostNameOrAddress, Int32 timeout, Byte[] buffer, PingOptions options) at ....

试图访问路径,得到下面的异常

System.UnauthorizedAccessException: Access to the path '\\\xxxxxx\test' is denied. at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound) at System.IO.Enumeration.FileSystemEnumerator`1.Init() at ....

【问题讨论】:

    标签: azure azure-functions access-denied vnet


    【解决方案1】:

    您无法启动从 Azure Functions 到本地的连接,网络连接只能由连接到专用端点、服务提供商(在本例中为 Azure Functions) 没有任何路由配置来启动与服务消费者的连接。只能在一个方向上建立连接。

    如果 onprem 文件夹是 OneDrive 文件夹,您可以选择使用 Microsoft Graph API 发送到可能是您的函数应用程序的 webhook。详情在这里。

    https://docs.microsoft.com/en-us/graph/webhooks

    这只是一个选项,我对您的方案的信息有限。

    【讨论】:

    • 嗨@Ken,我错误地解释了我的情况,对此感到抱歉。每 5 分钟,Azure 服务从本地文件夹中获取文件并处理它们。这是相当简单的操作。据我了解,有一个 VNet 选项可以将虚拟网络连接到本地网络,反之亦然。我们已经为服务完成了,但仍然无法访问本地网络
    • 没问题。在您的评论中,您说 Azure 服务获取文件(我假设您所指的服务是 Azure Functions)。如果是这样,那么您正在尝试从 Azure 连接到 OnPrem,这是不允许通过专用端点连接的。您需要找到一种方法将这些文件传输到云端(OneDrive、通过 AzCopy 的 Azure 存储、Azure 文件同步等),然后对其进行处理。
    猜你喜欢
    • 2021-07-16
    • 2015-07-25
    • 2022-10-19
    • 2020-12-29
    • 2021-04-27
    • 2017-11-08
    • 2011-03-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多