支持政府社区云 (gcc) 中的 Azure 搜索服务
Support for Azure search service in government community cloud (gcc)
我正在尝试将一些数据编入索引以搜索服务并使用政府云中的搜索查询检索它。搜索服务 Url 以 (.search.azure.us) 结尾。这不同于 URL 以 (.search.windows.net) 结尾的普通 azure 搜索服务。
我们的团队使用 Azure .Net SDK 版本 5,我看到当我使用服务名称创建 SearchIndexClient 时,构造函数会验证服务 url 并始终在末尾附加 .search.windows.net它并且对于 gcc urls like *.search.azure.us 会失败。
我正在查看 Azure 搜索客户端库,SearchIndexClient 始终使用 .search.wndows.net 后缀
进行验证
private static void ValidateSearchServiceAndIndexNames(string searchServiceName, string indexName)
{
Throw.IfNullOrEmptySearchServiceName(searchServiceName);
SearchIndexClient.ThrowIfNullOrEmptyIndexName(indexName, nameof (indexName));
if (TypeConversion.TryParseUri(string.Format("https://{0}.search.windows.net/indexes('{1}')/",
(object) searchServiceName, (object) indexName)) == (Uri) null)
throw new ArgumentException(string.Format("Either the search service name '{0}' or the index name
'{1}' is invalid. Names must contain only characters that are valid in a URL.", (object)
searchServiceName, (object) indexName), nameof (searchServiceName));
}
那么是否有可用的升级版本的 sdk,搜索索引客户端可以支持 URLs,如“.search.azure.us”?或政府云 urls?
的任何其他推荐方式
是否像在 searchIndexClient 上正确设置 SearchDnsSuffix 属性 到适当的后缀一样简单?
您能分享一下您是如何实例化 SearchIndexClient 的吗?我的预感是您在搜索服务或索引名称中包含了域后缀,这会触发您看到的错误。尝试将 SearchDnsSuffix
设置为 "search.azure.us".
我正在尝试将一些数据编入索引以搜索服务并使用政府云中的搜索查询检索它。搜索服务 Url 以 (.search.azure.us) 结尾。这不同于 URL 以 (.search.windows.net) 结尾的普通 azure 搜索服务。
我们的团队使用 Azure .Net SDK 版本 5,我看到当我使用服务名称创建 SearchIndexClient 时,构造函数会验证服务 url 并始终在末尾附加 .search.windows.net它并且对于 gcc urls like *.search.azure.us 会失败。
我正在查看 Azure 搜索客户端库,SearchIndexClient 始终使用 .search.wndows.net 后缀
进行验证private static void ValidateSearchServiceAndIndexNames(string searchServiceName, string indexName)
{
Throw.IfNullOrEmptySearchServiceName(searchServiceName);
SearchIndexClient.ThrowIfNullOrEmptyIndexName(indexName, nameof (indexName));
if (TypeConversion.TryParseUri(string.Format("https://{0}.search.windows.net/indexes('{1}')/",
(object) searchServiceName, (object) indexName)) == (Uri) null)
throw new ArgumentException(string.Format("Either the search service name '{0}' or the index name
'{1}' is invalid. Names must contain only characters that are valid in a URL.", (object)
searchServiceName, (object) indexName), nameof (searchServiceName));
}
那么是否有可用的升级版本的 sdk,搜索索引客户端可以支持 URLs,如“.search.azure.us”?或政府云 urls?
的任何其他推荐方式是否像在 searchIndexClient 上正确设置 SearchDnsSuffix 属性 到适当的后缀一样简单?
您能分享一下您是如何实例化 SearchIndexClient 的吗?我的预感是您在搜索服务或索引名称中包含了域后缀,这会触发您看到的错误。尝试将 SearchDnsSuffix
设置为 "search.azure.us".