Skip to content

Commit 3cb4c2f

Browse files
Merge pull request #304 from HeidiSteen/heidist-rag
Add tenant ID step to RAG tutorial
2 parents 29b0844 + 4b83685 commit 3cb4c2f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

articles/search/search-get-started-rag.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,28 @@ This section uses Visual Studio Code and Python to call the chat completion APIs
272272

273273
You might also try the query without semantic ranking by setting `use_semantic_reranker=False` in the query parameters step. Semantic ranking can noticably improve the relevance of query results and the ability of the LLM to return useful information. Experimentation can help you decide whether it makes a difference for your content.
274274

275+
## Troubleshooting errors
276+
277+
To debug authentication errors, insert the following code before the step that calls the search engine and the LLM.
278+
279+
```python
280+
import sys
281+
import logging # Set the logging level for all azure-storage-* libraries
282+
logger = logging.getLogger('azure.identity')
283+
logger.setLevel(logging.DEBUG)
284+
285+
handler = logging.StreamHandler(stream=sys.stdout)
286+
formatter = logging.Formatter('[%(levelname)s %(name)s] %(message)s')
287+
handler.setFormatter(formatter)
288+
logger.addHandler(handler)
289+
```
290+
291+
Rerun the query script. You should now get INFO and DEBUG statements in the output that provide more detail about the issue.
292+
293+
If you see output messages related to ManagedIdentityCredential and token acquisition failures, it could be that you have multiple tenants, and your Azure sign-in is using a tenant that doesn't have your search service. To get your tenant ID, search the Azure portal for "tenant properties".
294+
295+
Run `az login --tenant <YOUR-TENANT-ID>` at a command prompt, and then rerun the script.
296+
275297
## Clean up
276298

277299
When you're working in your own subscription, it's a good idea at the end of a project to identify whether you still need the resources you created. Resources left running can cost you money. You can delete resources individually or delete the resource group to delete the entire set of resources.

0 commit comments

Comments
 (0)