Azure函数执行可以确定其自己的传出/外部IP地址吗? [英] Can an Azure Function execution determine its own outgoing/external IP address?

查看:58
本文介绍了Azure函数执行可以确定其自己的传出/外部IP地址吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管您可以查找服务或数据中心的范围,但使用消费"托管计划时,该功能没有特定的传出/公用IP地址.我的问题是:对于特定实例或某个功能的执行,是否可以在运行时告诉它自己(或将要)的公共IP地址是什么,而无需查询ipchicken.com之类的服务?对于后续的外发请求,查询外部服务是否还能工作或可靠?

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?

推荐答案

官方指南是您需要使用数据中心IP地址来确保安全,其余的则不能保证.在

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.

这就是为什么他们在功能应用程序的属性中隐藏出站IP地址"字段的原因.

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

但是,看起来这些出站IP地址在实践中可以安全使用,因此您可以自行承担风险.您可以在资源浏览器的outboundIpAddresses属性下的https://resources.azure.com/subscriptions/{guid}/resourceGroups/{rg}/providers/Microsoft.Web/sites/{functionapp}之类的URL上找到它们.还有possibleOutboundIpAddresses,也许使用它们更安全.

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.

请参见在消费计划下运行的Azure功能的IP地址白名单以获得来自Azure用户的更多评论.

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

这篇关于Azure函数执行可以确定其自己的传出/外部IP地址吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆