Azure Bing 图像搜索客户端抛出找不到资源

Azure Bing Image Search client throws resource not found

我正在尝试使用 bing 图片搜索 SDK,但本教程对我不起作用:

https://docs.microsoft.com/en-us/azure/cognitive-services/bing-image-search/quickstarts/client-libraries?pivots=programming-language-python

from azure.cognitiveservices.search.imagesearch import ImageSearchClient 
from msrest.authentication import CognitiveServicesCredentials

# This is my key generated by azure portal
subscription_key = "XXXXXXXXXXXXXXXXX"
# This is my endpoint generated by azure portal
subscription_endpoint = "https://vadmeggy-image-search.cognitiveservices.azure.com/bing/v7.0"
search_term = "bird"

client = ImageSearchClient(endpoint=subscription_endpoint, credentials=CognitiveServicesCredentials(subscription_key))
image_results = client.images.search(query=search_term)

异常:

azure.cognitiveservices.search.imagesearch.models._models_py3.ErrorResponseException: Operation returned an invalid status code 'Resource Not Found'

我错过了什么?我调用了 REST API,它与给定的订阅密钥配合得很好。 如果 SDK 不起作用,我可以回退到 REST API,但也许有人可以帮助我。

Python实现自动添加Bing版本,你需要使用

subscription_endpoint = "https://vadmeggy-image-search.cognitiveservices.azure.com"

一切都会好起来的。文档和实现似乎不同步。