你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
SearchCredentials(String) 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用查询密钥或管理密钥初始化 SearchCredentials 类的新实例。 如果应用程序不需要对搜索服务或索引的写入访问权限,请使用查询密钥。
public SearchCredentials (string apiKey);
new Microsoft.Azure.Search.SearchCredentials : string -> Microsoft.Azure.Search.SearchCredentials
Public Sub New (apiKey As String)
参数
- apiKey
- String
用于向搜索服务进行身份验证的 api-key。
注解
如果应用程序仅对索引执行查询操作,建议为 apiKey
参数传递查询键。 这可确保你对索引具有只读访问权限,这与最低特权原则一致。