HTTP Trigger Azure Function App部署到Azure后仅23秒就超时问题
Azure Function App发布后调用外部WebService超时问题
我有一个通过App Service Plan托管的HTTP触发类型Azure Function App,功能是调用外部WebService并传递包含XML的SOAP消息。
本地使用VS2019运行时,该函数可以成功访问目标Web服务,25秒或更短时间内就能收到响应;但发布到Azure环境后,函数运行不到23秒就会超时,返回HTTP 500错误,错误日志如下:
2021-10-20T09:54:46.263 [Error] Executed 'XXXX' (Failed, Id=0cc4db22-f9ba-4c5d-9f6e-ecd1da394333, Duration=22131ms)A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
解决方案
该问题已通过为Function App所有出站请求配置虚拟网络的方式解决,操作方法可参考Azure官方文档《将 NAT 网关与 Azure Functions 配合使用》。
内容的提问来源于stack exchange,提问作者Zain
相关产品推荐
相关产品推荐

