Azure eventgrid 为Azure函数创建EvenGridSubscription时,尝试验证提供的终结点失败

Azure eventgrid 为Azure函数创建EvenGridSubscription时,尝试验证提供的终结点失败,azure-eventgrid,Azure Eventgrid,我正在尝试为使用EventGridTrigger的Azure函数创建EventGridSubscription。 运行New-AzureRmEventGridSubscription cmdlet时,我看到以下错误: Url验证:尝试验证提供的终结点失败 以下是azure功能代码: [FunctionName("BlobCreatedHandler")] public static async Task Run([EventGridTrigger]JObject blobEvent, [

我正在尝试为使用EventGridTrigger的Azure函数创建EventGridSubscription。 运行New-AzureRmEventGridSubscription cmdlet时,我看到以下错误:

Url验证:尝试验证提供的终结点失败

以下是azure功能代码:

[FunctionName("BlobCreatedHandler")]
public static async Task Run([EventGridTrigger]JObject blobEvent,
    [Queue("blob-created-queue", Connection = Strings.StorageAccountConnection)] CloudQueue blobCreatedQueue,
    [Inject(typeof(IBlobCreatedHandler))] IBlobCreatedHandler blobCreatedHandler)
{
    await blobCreatedHandler.Handle(blobEvent, blobCreatedQueue);
}
我尝试了不同版本的AzureRM.EventGrid模块。有趣的是,在低于0.3.0的版本上,它运行良好。但是从0.3.1开始的所有最新版本都因此错误而失败。 有人也有同样的经历吗

UPD: Fiddler说SDK的两个版本(好版本和坏版本)都发送完全相同的请求:

{
"properties": {
    "destination": {
        "endpointType": "WebHook",
        "properties": {
            "endpointUrl": "https://blobmalwarescanapptest.azurewebsites.net/admin/EventGridExtensionConfig?functionName=TestFunc&code=PhWghMXtSma188UQccaoErA4Eiw7ygudguHkpq1V0XKMfzA59yBR5g=="
        }
    },
    "filter": {
        "includedEventTypes": [
            "All"
        ],
        "isSubjectCaseSensitive": false
    }
}
得到完全相同的回答。
但在较新版本的SDK上,Azure EventGrid管理端点似乎会截断“?”符号之后的所有内容,并尝试验证基本url(无查询参数)。

我刚刚使用ARM模板实现了相同的结果。对我有效的终点是:
https://.azurewebsites.net/runtime/webhooks/EventGrid?functionName=&code=

尽管这也适用于azure函数的v2,而且我看到您使用的是v1(因为JObject作为eventgrid触发器)

编辑:我的手臂模板示例:

{
  "type": "Microsoft.Storage/storageAccounts/providers/eventSubscriptions",
  "name": "[concat(variables('MobileStorageName'), '/Microsoft.EventGrid/', variables('EventSubscriberName'))]",
  "apiVersion": "2018-01-01",
  "dependsOn": [
    "[variables('MobileStorageName')]"
  ],
  "tags": {
    "displayName": "Storage Account Event Subscription"
  },
  "properties": {
    "destination": {
      "endpointType": "WebHook",
      "properties": {
        "endpointUrl": "[variables('FunctionAppEndpoint')]"
      }
    },
    "filter": {
      "subjectBeginsWith": "",
      "subjectEndsWith": "",
      "isSubjectCaseSensitive": false,
      "includedEventTypes": [ "Microsoft.Storage.BlobCreated" ]
    }
  }
}

请注意,在我的例子中,我需要StorageV2(它是2018-02-1 api),否则它不起作用。

我尝试了您的端点:它可能与ARM模板一起工作,但与最新版本的AzureRM.Eventgrid PS模块也不起作用(这可能是因为您在模板中使用了较旧版本的api?只是猜测)。我在旧版本上尝试过:端点验证通过,但事件本身无法传递,azure函数未被触发。您在ARM模板中的目标API版本是什么?(我想将其与PS cmdlet使用的模板进行比较)@SiarheiMachel我添加了arm模板的一个片段,以便您进行比较。