简体   繁体   中英

How to trigger azure Function in same App

I have an Azure function project with two functions. One which is triggered by a timer and one that is triggered by HTTP. How to I trigger the http manually from code? I know I can trigger it using the URL, but the URL will change when the function is deployed.

1) You can use of the HTTP client if the intention is to call from the code only.

 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM