【问题标题】:How to resolve this Azure Event Grid Subscription error?如何解决此 Azure 事件网格订阅错误?
【发布时间】:2018-07-17 07:53:42
【问题描述】:

我正在尝试使用 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

这是什么原因以及如何解决?

【问题讨论】:

    标签: c# .net azure webhooks azure-eventgrid


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      这是因为您使用的命令 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
      

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

      【讨论】:

      • 嗨,@GilliVilla 你的问题怎么样?这个答案有用吗?
      猜你喜欢
      • 1970-01-01
      • 2020-02-22
      • 2018-03-18
      • 2018-12-12
      • 2021-03-22
      • 1970-01-01
      • 2019-12-23
      • 2021-02-22
      • 2018-10-10
      相关资源
      最近更新 更多