[英]How to trigger azure Function in same App
I have an Azure function project with two functions.我有一个具有两个功能的 Azure function 项目。 One which is triggered by a timer and one that is triggered by HTTP.一种由定时器触发,一种由 HTTP 触发。 How to I trigger the http manually from code?如何从代码中手动触发 http? I know I can trigger it using the URL, but the URL will change when the function is deployed.我知道我可以使用 URL 触发它,但 URL 会在部署 function 时发生变化。
1) You can use of the HTTP client if the intention is to call from the code only. 1) 如果打算仅从代码调用,您可以使用 HTTP 客户端。
using(var client = new HttpClient()) { client.BaseAddress = new Uri("https://www.google.com"); var result = await client.GetAsync(""); string resultContent = await result.Content.ReadAsStringAsync(); log.Info(resultContent); }
2) Other option is use Durable Functions , particularly Function Chaining 2) 其他选项是使用持久功能,特别是Function 链接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.