Reputation: 9387
I have a DB hosted on a VM and a NSG setup around the VM. Not I need azure functions to access the VM.
How would I configure NSG to allow Azure Functions to access the VM
Upvotes: 0
Views: 3044
Reputation: 28204
As @DixitArora-MSFT's comment mentioned, you could whitelist 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.
If you want to whitelist only with a known IP address, seems that the only way is to use a third-party proxy service or a different fundamental technology. Refer to this.
Furthermore, since your DB is hosted on Azure VM, I think you also could consider integrating a function app with an Azure virtual network for securely accessing the VM in a private network.
Upvotes: 2