azure - Azure 搜索、listAdminKeys、ARM 输出错误(不支持 http 方法 'POST')
问题描述
我在我的 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)。
如何避免此错误并在输出中检索 AzureSearch 管理密钥?
更新:这样做的目的是收集所有相关信息以作为参数插入其他脚本 (.ps1),因为这些资源是由该模板提供的。将避免有人通过门户挖掘复制/粘贴。
谢谢
解决方案
您的错误来自 listQueryKeys,而不是管理键。
https://docs.microsoft.com/en-us/rest/api/searchmanagement/adminkeys/get
https://docs.microsoft.com/en-us/rest/api/searchmanagement/querykeys/listbysearchservice
您将无法检索 arm 模板中的那些,它只能“模拟” POST 调用,而不是 GET
推荐阅读
- amazon-web-services - 是否可以将 AWS StepFunction 状态转换作为事件/回调?
- c# - 获取发布版本属性 Visual Studio 2019
- node.js - Passportjs - 如果路由中不存在“passport.authenticate”作为中间件,则将 req.user 设为“未定义”
- powerbi-desktop - 通过聚合字符串值在 PowerBI 中创建条形图
- plot - Veusz 平滑曲线
- c# - 使用 Microsoft.Web.Administration 应用程序更改身份验证模式
- anylogic - 启动时在 Anylogic 中更改 GIS 路由
- python - 从烧瓶服务器提供大量图像
- visual-studio-code - VScodevim 如何跳转到一个非常大的列位置
- python - sqlite3.OperationalError:靠近“)”:tkinter Python中的语法错误