Comments (12)
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.
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.
from azure-search-openai-demo.
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.
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.
@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
from azure-search-openai-demo.
Hi
@spedditi , here it goes
I was able to bring more pdfs by running prepdocs.ps1 again
from azure-search-openai-demo.
@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.
@spedditi I am closing this after #10
Please re-open if you keep getting this error
from azure-search-openai-demo.
@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.
@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.
@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)
- suggestions for ways to give access to resources in main storage HOT 1
- Setting up optional login HOT 3
- Should `AAD` be changed to `Azure Entra ID`? HOT 2
- Deleting The "ASK" tab HOT 1
- Search resource fails in swedencentral HOT 1
- Use "evaluation app" when the login is required in the "chat app" HOT 2
- Advanced RAG
- Chat answer layout differs in oai from deployment HOT 1
- I am not able to change the "Retrieval mode" in the UX
- Request for company Azure account (needed to get Azure OpenAI account) fails.
- Supporting files with apostrophy / punctuation mark in the file name HOT 3
- local running error: Incomplete environment configuration for EnvironmentCredential. HOT 3
- Error in login_and_acl.md when using ./script/manage.acl should be --document, not --url HOT 4
- adlsgen2setup fails three bugs - 1. cannot set AZURE_ADLS_GEN2_STORAGE_ACCOUNT 2. ./data/* should be ./data in adlsgensetup.sh and 3. Code changes required in adlsgensetup.py HOT 1
- Can we get some examples for AZURE_ADLS_GEN2_FILESYSTEM_PATH and how to use it in documentation please HOT 5
- Unauthorized Access to endpoints in production HOT 6
- Integration of a voice input and output option with Speech Services HOT 1
- CannotDeleteOrUpdateEnabledEntitlement: Permission (scope or role) cannot be deleted or updated unless disabled first
- Is there a way not to use DI? HOT 1
- Index not found - looks like hooks are not fired up HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-search-openai-demo.