如何使azure函数处理程序在Spring云函数中工作?
我一直在尝试使用SpringCloudFunctionsConnector连接Azure函数,但由于某些原因,我的处理程序没有被调用。我已经做了一些测试来尝试和调试它,但简单的事实是处理程序并没有被调用,我尝试了日志,但它从来没有工作过。我的函数将在任何url中被调用,而不仅仅是http触发器。 这是我的处理程序:如何使azure函数处理程序在Spring云函数中工作?,spring,azure,spring-boot,azure-functions,Spring,Azure,Spring Boot,Azure Functions,我一直在尝试使用SpringCloudFunctionsConnector连接Azure函数,但由于某些原因,我的处理程序没有被调用。我已经做了一些测试来尝试和调试它,但简单的事实是处理程序并没有被调用,我尝试了日志,但它从来没有工作过。我的函数将在任何url中被调用,而不仅仅是http触发器。 这是我的处理程序: package com.scc.functions; import org.springframework.cloud.function.adapter.azure.AzureSp
package com.scc.functions;
import org.springframework.cloud.function.adapter.azure.AzureSpringBootRequestHandler;
import com.microsoft.azure.functions.ExecutionContext;
import com.microsoft.azure.functions.HttpMethod;
import com.microsoft.azure.functions.HttpRequestMessage;
import com.microsoft.azure.functions.annotation.AuthorizationLevel;
import com.microsoft.azure.functions.annotation.FunctionName;
import com.microsoft.azure.functions.annotation.HttpTrigger;
public class BasicHandler extends AzureSpringBootRequestHandler<Void, String> {
@FunctionName("hello")
public String execute(
@HttpTrigger(name = "hello", methods = HttpMethod.GET, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage<Void> request,
ExecutionContext context) {
//This log doesnt show, i replace it with throw new RuntimeException(), and that still does't run
context.getLogger().info("Greeting user name: " + "oi");
return "hello";
}
}
package com.scc.functions;
导入org.springframework.cloud.function.adapter.azure.AzureSpringBootRequestHandler;
导入com.microsoft.azure.functions.ExecutionContext;
导入com.microsoft.azure.functions.HttpMethod;
导入com.microsoft.azure.functions.HttpRequestMessage;
导入com.microsoft.azure.functions.annotation.AuthorizationLevel;
导入com.microsoft.azure.functions.annotation.FunctionName;
导入com.microsoft.azure.functions.annotation.HttpTrigger;
公共类BasicHandler扩展AzureSpringBootRequestHandler{
@函数名(“你好”)
公共字符串执行(
@HttpTrigger(name=“hello”,methods=HttpMethod.GET,authLevel=AuthorizationLevel.ANONYMOUS)HttpRequestMessage请求,
ExecutionContext(上下文){
//此日志没有显示,我将其替换为throw new RuntimeException(),但它仍然没有运行
context.getLogger().info(“问候用户名:“+”oi”);
回复“你好”;
}
}
这是我的功能:
@Bean
public Function<Void, String> hello() {
return it -> "this is a test";
}
@Bean
公共函数hello(){
返回->“这是一个测试”;
}
我如何让它通过我的实际处理程序运行这些东西