![](/img/trans.png)
[英]How to add custom startup class in http trigger azure function app
[英]How to trigger azure Function in same App
我有一個具有兩個功能的 Azure function 項目。 一種由定時器觸發,一種由 HTTP 觸發。 如何從代碼中手動觸發 http? 我知道我可以使用 URL 觸發它,但 URL 會在部署 function 時發生變化。
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) 其他選項是使用持久功能,特別是Function 鏈接
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.