Giter Club home page Giter Club logo

Comments (12)

davidcervigon avatar davidcervigon commented on May 20, 2024 2

Same here. azd credentials are not being used by ./scripts/prepdocs.py correctly. I have also tried to open a different PowerShell session, run "azd login" then .\scripts\prepdocs.ps1 manually

Ensuring search index gptkbindex exists
DefaultAzureCredential failed to retrieve a token from the included credentials.
Attempted credentials:
EnvironmentCredential: EnvironmentCredential authentication unavailable. Environment variables are not fully configured.
Visit https://aka.ms/azsdk/python/identity/environmentcredential/troubleshoot to troubleshoot.this issue.
ManagedIdentityCredential: ManagedIdentityCredential authentication unavailable, no response from the IMDS endpoint.
SharedTokenCacheCredential: Azure Active Directory error '(invalid_grant) AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2022-11-16T23:36:02.7494127Z and was inactive for 90.00:00:00.
Trace ID: 449a7461-1dbd-44c8-b226-f3b8674f0200
Correlation ID: 96f0545b-708f-4523-b819-f98b91adc661
Timestamp: 2023-03-12 00:55:11Z'
Content: {"error":"invalid_grant","error_description":"AADSTS700082: The refresh token has expired due to inactivity. The token was issued on 2022-11-16T23:36:02.7494127Z and was inactive for 90.00:00:00.\r\nTrace ID: 449a7461-1dbd-44c8-b226-f3b8674f0200\r\nCorrelation ID: 96f0545b-708f-4523-b819-f98b91adc661\r\nTimestamp: 2023-03-12 00:55:11Z","error_codes":[700082],"timestamp":"2023-03-12 00:55:11Z","trace_id":"449a7461-1dbd-44c8-b226-f3b8674f0200","correlation_id":"96f0545b-708f-4523-b819-f98b91adc661","error_uri":"https://login.microsoftonline.com/error?code=700082"}
To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azsdk/python/identity/defaultazurecredential/troubleshoot.

I solved the issue by installing Az module in PowerShell 7:

Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force

Then running:

connect-azaccount
.\scripts\prepdocs.ps1

from azure-search-openai-demo.

spedditi avatar spedditi commented on May 20, 2024

update, I fixed AzureCli issue. But now getting Authorization failed error

Traceback (most recent call last):
File "………...Documents\workspace\lia\azure-search-openai-demo\scripts\prepdocs.py", line 208, in
create_search_index()
File "………...Documents\workspace\lia\azure-search-openai-demo\scripts\prepdocs.py", line 146, in create_search_index
if args.index not in index_client.list_index_names():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\paging.py", line 132, in next
return next(self._page_iterator)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\paging.py", line 76, in next
self._response = self._get_next(self.continuation_token)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\search\documents\indexes_generated\operations_indexes_operations.py", line 520, in get_next
raise HttpResponseError(response=response, model=error)
azure.core.exceptions.HttpResponseError: () Authorization failed.
Code:
Message: Authorization failed.

from azure-search-openai-demo.

spedditi avatar spedditi commented on May 20, 2024

image

image

from azure-search-openai-demo.

JoeNSalloum avatar JoeNSalloum commented on May 20, 2024

Make sure the sourcepage field in your Search Service indexer is flagged as 'retrievable', looks like you may have created the index manually?

from azure-search-openai-demo.

jhuims avatar jhuims commented on May 20, 2024

I have tried to install AZ module for powershell 7 as davidcervigon mentioned, not work for me. My quick workaround is ..

open up prepdocs.ps1, add the --searchkey parameter , this searchkey can grab from portal under Cognitive Search resource.

python ./scripts/prepdocs.py '.\data\*' --searchkey xxxx --storageaccount $env:AZURE_STORAGE_ACCOUNT....

I do it while resources are spinning up before the execution of prepdocs.ps1 .

from azure-search-openai-demo.

spedditi avatar spedditi commented on May 20, 2024

@jhuims @davidcervigon @JoeNSalloum can you share your azure search field screen. I am getting this error (Error: unsupported operand type(s) for +: 'NoneType' and 'str' ), i think search results are null . Thank you

image
image
image

from azure-search-openai-demo.

davidcervigon avatar davidcervigon commented on May 20, 2024

Hi

@spedditi , here it goes

image

I was able to bring more pdfs by running prepdocs.ps1 again

from azure-search-openai-demo.

vhvb1989 avatar vhvb1989 commented on May 20, 2024

@spedditi, This PR fixes this issue: #10
In case you want to try it.

The prepdocs.py should use the same auth as azd, instead of letting folks to figure out how to set the DefaultAzureCredential for auth.

from azure-search-openai-demo.

vhvb1989 avatar vhvb1989 commented on May 20, 2024

@spedditi I am closing this after #10
Please re-open if you keep getting this error

from azure-search-openai-demo.

EMiller124 avatar EMiller124 commented on May 20, 2024

@vhvb1989 I am continuing to get this error. Like others have said, there is no error code and the message is just 'Authorization failed.'

I've checked and Form Reader and Blob Storage work fine, the only problem is when trying to connect to Cognitive Search

from azure-search-openai-demo.

vhvb1989 avatar vhvb1989 commented on May 20, 2024

@EMiller124 , have you tried using latest changes from the repo? a search-role was recently added (https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/infra/main.bicep#L271). Can you check if you have this changes on your end?

from azure-search-openai-demo.

EMiller124 avatar EMiller124 commented on May 20, 2024

@vhvb1989 I did not have that bit actually. I got it working with the work around of using searchkey mentioned above but if I run into another issue I'll add that in as well. Thank you!

from azure-search-openai-demo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.