Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/54.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何解决此Azure事件网格订阅错误?_C#_.net_Azure_Webhooks_Azure Eventgrid - Fatal编程技术网

C# 如何解决此Azure事件网格订阅错误?

C# 如何解决此Azure事件网格订阅错误?,c#,.net,azure,webhooks,azure-eventgrid,C#,.net,Azure,Webhooks,Azure Eventgrid,我正在尝试使用Azure CLI命令为我的Azure EventGrid主题创建订阅,如下所示- az eventgrid topic event-subscription create -g myresname --topic-name mytopicname --name mysubscriptionname --endpoint https://xyz.azurewebsites.net/api/mywebhookdetails 我在Azure CLI中的BASH shell中遇到此错误

我正在尝试使用Azure CLI命令为我的Azure EventGrid主题创建订阅,如下所示-

az eventgrid topic event-subscription create -g myresname --topic-name mytopicname --name mysubscriptionname --endpoint https://xyz.azurewebsites.net/api/mywebhookdetails
我在Azure CLI中的BASH shell中遇到此错误

az eventgrid topic: error: argument _subcommand: invalid choice: event-subscription

原因是什么以及如何解决此问题?

上个月有一次CLI更新,该更新引入了此语法中的一些更改。请使用以下命令(唯一的区别是不需要在eventgrid之后指定“主题”):


az eventgrid事件订阅创建-g myresname--主题名称mytopicname--名称mysubscriptionname--端点

上个月有一次CLI更新,对该语法进行了一些更改。请使用以下命令(唯一的区别是不需要在eventgrid之后指定“主题”):


az eventgrid事件订阅创建-g myresname--主题名称mytopicname--名称mysubscriptionname--端点

这是因为您使用的命令az eventgrid主题事件订阅创建不适用于最新版本的Azure CLI

您可以在Azure CLI中使用此命令:

az eventgrid event-subscription create --endpoint
                                       --name
                                       [--endpoint-type {eventhub, webhook}]
                                       [--included-event-types]
                                       [--labels]
                                       [--resource-group]
                                       [--resource-id]
                                       [--subject-begins-with]
                                       [--subject-case-sensitive {false, true}]
                                       [--subject-ends-with]
                                       [--topic-name]
示例:

az eventgrid event-subscription create -g myresname --topic-name mytopicname --name mysubscriptionname --endpoint https://xyz.azurewebsites.net/api/mywebhookdetails

您可以在中查看更多详细信息。

这是因为您使用的命令
az eventgrid topic event subscription create
不适用于最新版本的Azure CLI

您可以在Azure CLI中使用此命令:

az eventgrid event-subscription create --endpoint
                                       --name
                                       [--endpoint-type {eventhub, webhook}]
                                       [--included-event-types]
                                       [--labels]
                                       [--resource-group]
                                       [--resource-id]
                                       [--subject-begins-with]
                                       [--subject-case-sensitive {false, true}]
                                       [--subject-ends-with]
                                       [--topic-name]
示例:

az eventgrid event-subscription create -g myresname --topic-name mytopicname --name mysubscriptionname --endpoint https://xyz.azurewebsites.net/api/mywebhookdetails

您可以在中查看更多详细信息。

Hi,@GilliVilla您的问题如何?这个答案有用吗?嗨,@GilliVilla你的问题呢?这个答案有用吗?