【发布时间】:2019-06-25 00:33:31
【问题描述】:
我做错了什么或如何使它起作用? 我正在使用 Azure Runtime v1(需要使用 .NET Framework,而不是核心)。
Visual Studio中的函数代码如下:
// This is the default URL for triggering event grid function in the local environment.
// http://localhost:7071/admin/extensions/EventGridExtensionConfig?functionName={functionname}
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.Azure.WebJobs.Extensions.EventGrid;
namespace FunctionApp1
{
public static class Function1
{
[FunctionName("Function1")]
public static void Run([EventGridTrigger]Microsoft.Azure.EventGrid.Models.EventGridEvent eventGridEvent, TraceWriter log)
{
log.Info(eventGridEvent.Data.ToString());
}
}
}
当我尝试为该功能添加订阅时,无论是通过门户还是 cli,我都会收到以下错误:
PS Azure:\> az eventgrid event-subscription create -g [<myGroupName>] --topic-name data-generated --name Func1Subs --endpoint "https://[<myFunctionAppName>].azurewebsites.net/admin/extensions/EventGridExtensionConfig?functionName=Function1&code=[<code>]"
Argument 'resource_group_name' has been deprecated and will be removed in version '2.1.0'. Use '--source-resource-id' instead.
Argument 'topic_name' has been deprecated and will be removed in version '2.1.0'. Use '--source-resource-id' instead.
The attempt to validate the provided endpoint https://[<myFunctionAppName>].azurewebsites.net/admin/extensions/EventGridExtensionConfig failed. For more details, visit https://aka.ms/esvalidation.
我尝试了从https://[<myFunctionAppName>].azurewebsites.net/admin/host/systemkeys/eventgridextensionconfig_extension?code=[<master_key>] 上的 GET 请求获得的系统代码、默认密钥甚至主密钥本身——结果相同。
当使用门户上的按钮“添加事件网格订阅”时 - 我也在通知框中收到此错误。
当我在门户上创建功能时 - 创建订阅工作正常。
此外,当我将 .netcore 函数部署到 2.x 运行时 - 并使用门户按钮创建订阅时 - 这也可以正常工作。但就像我说的 - 我想使用 runtime 1.x 来部署一个 .NETFramework 函数。
【问题讨论】:
标签: c# .net azure azure-functions azure-eventgrid