如何配置 Azure Functions 以连接到 NSG 后面的 VM

How to configure Azure Functions to connect to VM behind an NSG

我在 VM 上托管了一个数据库,并在 VM 周围设置了 NSG。不是我需要 azure 函数来访问 VM。

我将如何配置 NSG 以允许 Azure Functions 访问 VM

正如@DixitArora-MSFT 的评论所述,您可以将 the function App outbound IP address. Since some actions may change the IP address such as changing your App Service plan pricing tier, you need to whitelist a set of possibleOutboundIpAddresses. Another option is to whitelist the function apps' data center (Azure region). You can download a JSON file that lists IP addresses for all Azure data centers.

列入白名单

如果你只想用已知的IP地址加入白名单,似乎唯一的办法就是使用第三方代理服务或不同的基础技术。参考this.

此外,由于您的数据库托管在 Azure VM 上,我认为您也可以考虑 integrating a function app with an Azure virtual network 在专用网络中安全访问 VM。