简体   繁体   English

如何在同一个应用程序中触发 azure Function

[英]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.

相关问题 如何在http触发器azure ZC1C425268E68385D14AB5074C17A9应用程序中添加自定义启动class - How to add custom startup class in http trigger azure function app 连接到Azure数据库的Azure Function App C#HTTP触发器 - Azure Function App C# HTTP Trigger connected to an Azure Database Azure Function App Azure 服务总线触发器触发两次 - Azure Function App Azure Service Bus trigger triggers twice Azure 队列触发器 function 应用程序如何仅在完成另一个队列消息后选择消息 - how Azure queue trigger function app can pick message after completion of another queue message only 如何使用计时器触发器将时区传递给 Azure 函数 - How to pass timezone to Azure function with timer trigger 如何在 Azure 函数 eventthub 触发器中处理 CancellationToken - How to handle CancellationToken in Azure function eventhub trigger 如何在azure webjob或函数中触发多个eventhub - How to trigger to multiple eventhubs in azure webjob or function 如何调用 Azure HTTP 触发器函数 - How to invoke an Azure HTTP trigger function Azure Function App & Web API 在同一解决方案中 - Azure Function App & Web API in same solution 使用 Azure Http 触发器函数应用将 Cosmos DB 与 OData 集成 - Integrating Cosmos DB with OData using Azure Http trigger function app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM