-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DefaultAzureCredential failed to retrieve a token from the included credentials #7
Comments
update, I fixed AzureCli issue. But now getting Authorization failed error Traceback (most recent call last): |
Make sure the sourcepage field in your Search Service indexer is flagged as 'retrievable', looks like you may have created the index manually? |
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 I solved the issue by installing Az module in PowerShell 7: Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force Then running: connect-azaccount |
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.
I do it while resources are spinning up before the execution of prepdocs.ps1 . |
@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 |
Hi @spedditi , here it goes I was able to bring more pdfs by running prepdocs.ps1 again |
@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 |
@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? |
@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! |
This issue is for a: (mark with an
x
)Minimal steps to reproduce
When i run azd up ( part of predocs.ps1), i am getting following error and search index gptkbindex didn't get created as part of this process. I created gptkbindex manually. Data files are not getting uploaded to storage account.
Any log messages given by the failure
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: SharedTokenCacheCredential authentication unavailable. No accounts were found in the cache.
AzureCliCredential: Azure CLI not found on path
AzurePowerShellCredential: Az.Account module >= 2.2.0 is not installed
To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azsdk/python/identity/defaultazurecredential/troubleshoot.
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 512, in get_next
pipeline_response = self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline_base.py", line 205, in run
return first_node.send(pipeline_request) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline_base.py", line 69, in send
response = self.next.send(request)
^^^^^^^^^^^^^^^^^^^^^^^
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline_base.py", line 69, in send
response = self.next.send(request)
^^^^^^^^^^^^^^^^^^^^^^^
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline_base.py", line 69, in send
response = self.next.send(request)
^^^^^^^^^^^^^^^^^^^^^^^
[Previous line repeated 2 more times]
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline\policies_redirect.py", line 160, in send
response = self.next.send(request)
^^^^^^^^^^^^^^^^^^^^^^^
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline\policies_retry.py", line 474, in send
response = self.next.send(request)
^^^^^^^^^^^^^^^^^^^^^^^
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline\policies_authentication.py", line 115, in send
self.on_request(request)
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\core\pipeline\policies_authentication.py", line 92, in on_request
self._token = self._credential.get_token(*self._scopes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\identity_credentials\default.py", line 168, in get_token
return super(DefaultAzureCredential, self).get_token(*scopes, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "………...AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\azure\identity_credentials\chained.py", line 101, in get_token
raise ClientAuthenticationError(message=message)
azure.core.exceptions.ClientAuthenticationError: 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: SharedTokenCacheCredential authentication unavailable. No accounts were found in the cache.
AzureCliCredential: Azure CLI not found on path
AzurePowerShellCredential: Az.Account module >= 2.2.0 is not installed
To mitigate this issue, please refer to the troubleshooting guidelines here at https://aka.ms/azsdk/python/identity/defaultazurecredential/troubleshoot.
Expected/desired behavior
OS and Version?
Versions
Mention any other details that might be useful
The text was updated successfully, but these errors were encountered: