Azure Document Intelligence begin_analyze_document错误:连接字符串为空或格式不正确

后端开发 2026-07-10

Python代码:

endpoint = "https://di-myService.cognitiveservices.azure.com/"
key = "ANZ...CzH"

formUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-REST-api-samples/master/curl/form-recognizer/sample-layout.pdf"

document_intelligence_client = DocumentIntelligenceClient(
            endpoint=endpoint, credential=AzureKeyCredential(key)   
        )

poller = document_intelligence_client.begin_analyze_document(
            "prebuilt-layout", AnalyzeDocumentRequest(url_source=formUrl
        ))

result: AnalyzeResult = poller.result()

在门户中运行这段代码时,我遇到了错误:

连接字符串为空或格式错误

解决方案

这是一个误报。代码在下游阶段失败,因为我在用连接字符串创建Blob客户端时,实际传入的是存储账户名。

站内所有文章版权归属LeftHeroAI导航站,无授权禁止任何主体转载、抄袭、复制内容,亦不得私自架设镜像站点。一经侵权,本站将通过法律途径追责。

相关文章