Azure-Samples / azure-search-openai-demo

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
https://azure.microsoft.com/products/search
MIT License
6.14k stars 4.18k forks source link

Issue in running prepdocs.ps1 from corporate network even when azure resources are configured to use selected network and private endpoint. #1208

Open VikashLalit opened 9 months ago

VikashLalit commented 9 months ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report ->  Not able to run prepdocs.ps1 in corporate network even if azure resources are configured to use selected network and private endpoint.

Minimal steps to reproduce

Run prepdocs.ps1 from my machine and all my azure open ai resource are configured for selected network and private endpoint.

Any log messages given by the failure

Extracting text from 'C:\Users\vik\git\Azure-Demo/data\Northwind_Health_Plus_Benefits_Details.pdf' using Azure Document Intelligence

Traceback (most recent call last):

File "C:\Users\vik\git\Azure-Demo\scripts\prepdocs.py", line 408, in

loop.run_until_complete(main(ingestion_strategy, azd_credential, args))

File "C:\Users\vik\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete

return future.result()

       ^^^^^^^^^^^^^^^

File "C:\Users\vik\git\Azure-Demo\scripts\prepdocs.py", line 233, in main

await strategy.run(search_info)

File "C:\Users\vik\git\Azure-Demo\scripts\prepdocslib\filestrategy.py", line 58, in run

pages = [page async for page in self.pdf_parser.parse(content=file.content)]

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\vik\git\Azure-Demo\scripts\prepdocslib\filestrategy.py", line 58, in

pages = [page async for page in self.pdf_parser.parse(content=file.content)]

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\vik\git\Azure-Demo\scripts\prepdocslib\pdfparser.py", line 81, in parse

poller = await form_recognizer_client.begin_analyze_document(model_id=self.model_id, document=content)

         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\vik\git\Azure-Demo\scripts.venv\Lib\site-packages\azure\core\tracing\decorator_async.py", line 77, in wrapper_use_tracer

return await func(*args, **kwargs)

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\vik\git\Azure-Demo\scripts.venv\Lib\site-packages\azure\ai\formrecognizer\aio_document_analysis_client_async.py", line 132, in begin_analyze_document

return await _client_op_path.begin_analyze_document(  # type: ignore

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\vik\git\Azure-Demo\scripts.venv\Lib\site-packages\azure\core\tracing\decorator_async.py", line 77, in wrapper_use_tracer

return await func(*args, **kwargs)

       ^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\vik\git\Azure-Demo\scripts.venv\Lib\site-packages\azure\ai\formrecognizer_generated\v2023_07_31\aio\operations_document_models_operations.py", line 189, in begin_analyze_document

raw_result = await self._analyze_document_initial(  # type: ignore

             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\vik\git\Azure-Demo\scripts.venv\Lib\site-packages\azure\ai\formrecognizer_generated\v2023_07_31\aio\operations_document_models_operations.py", line 114, in _analyze_document_initial

raise HttpResponseError(response=response)

**azure.core.exceptions.HttpResponseError: (403) Public access is disabled. Please configure private endpoint.

Code: 403

Message: Public access is disabled. Please configure private endpoint.**

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

azd version?

run azd version and copy paste here.

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

pamelafox commented 9 months ago

Did you set up the endpoints yourself or did you deploy the private endpoints pull request? You may want to check https://github.com/Azure-Samples/azure-search-openai-demo/pull/864 to see if you did anything differently than that PR.

VikashLalit commented 9 months ago

@pamelafox I have configured private endpoint and selected network using azure portal for my storage resource, openai resource, search resources.

Its working if i use azure openai studio to create my webapp .

But when i try to use this repo , prepdocs.ps1 script is failing with above error

pamelafox commented 5 months ago

We have now merged full support for private endpoints. See deployment guide here: https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/docs/deploy_private.md For prepdocs, we recommend first running it with private access disabled, then re-running it once the data is ingested.