Спасибо после использования новой версии, он работает нормально на локальном и лазурном

дал функцию Java Azure, как указано в следующей ссылке:

https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-java-maven

Класс Java:

package com.khan;

import java.util.*;
import com.microsoft.azure.serverless.functions.annotation.*;
import com.microsoft.azure.serverless.functions.*;

/**
 * Azure Functions with HTTP Trigger.
 */
public class Function {
    /**
     * This function listens at endpoint "/api/hello". Two ways to invoke it using "curl" command in bash:
     * 1. curl -d "HTTP Body" {your host}/api/hello
     * 2. curl {your host}/api/hello?name=HTTP%20Query
     */
    @FunctionName("hello")
    public HttpResponseMessage<String> hello(
            @HttpTrigger(name = "req", methods = {"get", "post"}, authLevel = AuthorizationLevel.ANONYMOUS) HttpRequestMessage<Optional<String>> request,
            final ExecutionContext context) {

        context.getLogger().info("Java HTTP trigger processed a request.");

        // Parse query parameter
        String query = request.getQueryParameters().get("name");
        String name = request.getBody().orElse(query);

        if (name == null) {
            return request.createResponse(400, "Please pass a name on the query string or in the request body");
        } else {
            return request.createResponse(200, "Hello, " + name);
        }

    }
}

Функция создана и успешно развернута

Теперь, когда я пытаюсь получить доступ с помощью curl

curl -w '\n' https://sundaydemo-20180526141357482.azurewebsites.net -d AzureFunctions

or postman 

https://sundaydemo-20180526141357482.azurewebsites.net/api/hello

Тогда получите следующую ошибку, мне интересно, если кто-то получит такую ​​же ошибку.

502 Неверный шлюз

В указанном приложении CGI обнаружена ошибка, и сервер завершил процесс.

Журналы:

2018-05-31T02:02:50  Welcome, you are now connected to log-streaming service.
2018-05-31T02:03:50  No new trace in the past 1 min(s).
2018-05-31T02:04:50  No new trace in the past 2 min(s).
2018-05-31T02:05:50  No new trace in the past 3 min(s).
2018-05-31T02:06:50  No new trace in the past 4 min(s).
2018-05-31T02:07:50  No new trace in the past 5 min(s).
2018-05-31T02:08:50  No new trace in the past 6 min(s).
2018-05-31T02:09:17.161 [Information] Executing 'Functions.hello' (Reason='This function was programmatically called via the host APIs.', Id=b43d17c9-35c0-4c84-ab7e-26a8ec721fe9)
2018-05-31T02:10:50  No new trace in the past 1 min(s).
2018-05-31T02:11:50  No new trace in the past 2 min(s).
2018-05-31T02:12:50  No new trace in the past 3 min(s).
2018-05-31T02:13:50  No new trace in the past 4 min(s).
2018-05-31T02:14:17.183 [Error] Timeout value of 00:05:00 exceeded by function 'Functions.hello' (Id: 'b43d17c9-35c0-4c84-ab7e-26a8ec721fe9'). Initiating cancellation.
2018-05-31T02:14:17.451 [Error] Microsoft.Azure.WebJobs.Host: Timeout value of 00:05:00 was exceeded by function: Functions.hello.
2018-05-31T02:14:17.572 [Error] Executed 'Functions.hello' (Failed, Id=b43d17c9-35c0-4c84-ab7e-26a8ec721fe9)
2018-05-31T02:15:50  No new trace in the past 1 min(s).
2018-05-31T02:16:50  No new trace in the past 2 min(s).
2018-05-31T02:17:50  No new trace in the past 3 min(s).
2018-05-31T02:18:50  No new trace in the past 4 min(s).

Также попытался удалить все и добавил CORS *

Место хранения :

Ответы на вопрос(1)

Ваш ответ на вопрос