Azure 搜索、listAdminKeys、ARM 输出错误(不支持 http 方法 'POST' )

标签 azure azure-resource-manager azure-cognitive-search azure-rm-template

我在 ARM 模板中使用这段代码作为输出对象,

    "[listAdminKeys(variables('searchServiceId'), '2015-08-19').PrimaryKey]"

输出部分的全文示例:

    "outputs": {
     "SearchServiceAdminKey": {
       "type": "string",
       "value": "[listAdminKeys(variables('searchServiceId'), '2015-08-19').PrimaryKey]"
      },

     "SearchServiceQueryKey": {
       "type": "string",
       "value": "[listQueryKeys(variables('searchServiceId'), '2015-08-19')[0]]"
      }

我在部署过程中收到以下错误(不幸的是,任何错误都意味着模板部署会跳过输出部分):

    "The requested resource does not support http method 'POST'."

检查浏览器行为似乎可以验证错误是否与该功能相关(并且它使用 POST)。

listAdminKeys using POST

如何避免此错误并在输出中检索 AzureSearch 管理 key ?

更新:这样做的目的是收集所有相关的信息,以作为参数插入其他脚本 (.ps1),因为这些资源是由该模板提供的。可以让某人免于通过门户进行复制/粘贴。

谢谢

最佳答案

您的错误来自 listQueryKeys,而不是管理 key 。

https://learn.microsoft.com/en-us/rest/api/searchmanagement/adminkeys/get
https://learn.microsoft.com/en-us/rest/api/searchmanagement/querykeys/listbysearchservice

您将无法检索arm模板中的那些内容,它只能“模拟”POST调用,而不是GET

关于Azure 搜索、listAdminKeys、ARM 输出错误(不支持 http 方法 'POST' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53416519/

相关文章:

azure - 如何在 Azure ML 中重用成功构建的 docker 镜像?

azure - Microsoft Graph API - 使用 Microsoft 帐户创建用户

python - 我正在尝试将索引推送到 Azurecognitive 搜索,但这会出现错误 ServiceRequestError : EOF occurred in violation of protocol (_ssl. c:2427)

azure - 如何在成功部署 Azure 模板时从事件网格获取事件

ruby - 从托管镜像创建虚拟机

Azure Blob 索引器元数据字段、编码

Azure 搜索相关性

Azure:BadRequest - 待处理的托管证书失败(域或证书请求触发了有风险的域检查)

azure - 如何在Azure上构建一个无需轮询的分布式聊天网站?

Azure ARM 模板单元测试