Azure 函数隔离工作进程 - HTTP 触发器触发但不运行函数

问题描述 投票:0回答:2

使用此处概述的 http 触发器 - https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide

[Function("HttpFunction")]
        public static HttpResponseData Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequestData req,
            FunctionContext executionContext)
        {
            var logger = executionContext.GetLogger("HttpFunction");
            logger.LogInformation("message logged");

            var response = req.CreateResponse(HttpStatusCode.OK);

            response.Headers.Add("Content-Type", "text/plain; charset=utf-8");

            response.WriteString("Welcome to .NET isolated worker !!");

            return response;
        }

我可以使用 http get 触发此操作,但是该函数随后不会运行。这里的阻塞因素可能是什么?

azure-functions azure-http-trigger dotnet-isolated
2个回答
0
投票
  • Function1.cs
    中放置一个断点。

  • 要运行并执行该功能,您需要打开 URL - (ctrl+单击)URL。

enter image description here

  • 运行上面的URL。

enter image description here

  • function key
    +
    f5
    ,现在您可以看到执行的函数和记录的消息。

enter image description here

enter image description here


0
投票

检查一下您是否已解决此问题。我遇到了同样的问题,我从进程中的 dotnet 6 转换为隔离的 dotnet 8,现在我可以调用所有端点并收到 204,但实际上没有任何内容进入函数

© www.soinside.com 2019 - 2024. All rights reserved.