[英]ARM deployment of Azure Search Service - Generate Query Key
我正在嘗試生成Azure搜索服務,並使其具有查詢鍵。 如何做以及以后如何在arm模板中檢索它?
到目前為止,我的搜索腳本是:
{
"apiVersion": "2015-08-19",
"name": "[variables('azureSearchName')]",
"location": "australiaeast",
"sku": {
"name": "basic"
},
"type": "Microsoft.Search/searchServices",
"properties": {
"replicaCount": 1,
"partitionCount": 1,
"hostingMode": "Default"
}
}
並獲取其管理密鑰:
"searchKey": {
"type": "string",
"value": "[listAdminKeys(resourceId('ResourceGroup', 'Microsoft.Search/searchServices', 'SearchName'), '2015-08-19').PrimaryKey]"
}
更新
從@ 4c74356b41回答后,我繼續進行一些挖掘,並在Microsoft.Search-/ searchServices / listQueryKeys / read上找到了此操作。 不幸的是,它是“讀取”而不是“動作”,因此當我嘗試像這樣使用它時:
"searchKey": {
"type": "object",
"value": "[listQueryKeys(resourceId('Microsoft.Search/searchServices', 'SearchName'), '2015-08-19')]"
}
我正進入(狀態
部署失敗。 相關編號:486ae99b-839d-43bf-93e7-f0e2afc3f19a。 {“ Message”:“所請求的資源不支持http方法'POST'。” }
如何使用GET調用它?
它可能看起來像這樣:
{
"apiVersion": "2015-08-19",
"name": "[concat(variables('azureSearchName'), '/keyNamegoesHere')]",
"location": "australiaeast",
"type": "Microsoft.Search/searchServices/createQueryKey"
}
但是如果那不起作用,我不會感到驚訝。 閱讀: https : //docs.microsoft.com/zh-cn/rest/api/searchmanagement/querykeys/create
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.