Can an Azure Function execution determine its own

2019-07-08 08:11发布

Using the Consumption hosting plan, there is no specific outgoing/public IP address for a Function, although you can look up ranges for the service or datacenter. My question is: for a specific instance or execution of a Function, can it tell at run-time what it's own public IP address is (or will be) without querying a service like ipchicken.com? Would querying an external service even work or be reliable for subsequent outgoing requests?

1条回答
仙女界的扛把子
2楼-- · 2019-07-08 08:34

The official guidance is that you need to use Data Center IP addresses to stay safe, the rest is not guaranteed. This is described in the second part of How do I determine the outbound IP addresses of my Azure App Service.

That's why they hide "Outbound IP Addresses" field in Properties of Function Apps.

However, it looks like those outbound IP addresses are safe to use in practice, so you can try that on your own risk. You can find them in Resource Explorer at URL like https://resources.azure.com/subscriptions/{guid}/resourceGroups/{rg}/providers/Microsoft.Web/sites/{functionapp} under outboundIpAddresses property. There are also possibleOutboundIpAddresses there, maybe it's safer to use those.

See IP Address white-listing for Azure Function running under Consumption Plan for more comments from Azure users.

查看更多
登录 后发表回答