Error while connecting to data in the 'Azure AI Search'

Kumar 0 Reputation points
2024-07-09T06:32:32.2133333+00:00

Hi,

While trying to connect to data and moving to next step, which is adding Cognitive Skills in Azure AI Search, I am receiving error 'Error detecting index schema from data source: "Authorization failed."'

Receiving the error while trying to finish the exercise https://microsoftlearning.github.io/mslearn-knowledge-mining/Instructions/Exercises/01-azure-search.html -> Index the documents section -> Step 3

I have given explicit IAM access to the storage container.

Any solution to fix this will be appreciated.

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,563 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SiddeshTN 3,945 Reputation points Microsoft Vendor
    2024-07-09T13:44:33.3333333+00:00

    Hi Kumar,

    Thank you for reaching out to us on Microsoft Q&A forum. 

    The error "Authorization failed" indicates that there might be an issue with the permissions or the way the connection is being established between Azure AI Search and the Azure Blob Storage.

    1.Ensure the Azure Cognitive Search service has permissions to access the Azure Storage account with your data by assigning a role like "Storage Blob Data Contributor" to its managed identity.
    2.Ensure CORS is properly configured on your Azure Storage account to allow services like Cognitive Search to make cross-origin requests.

    To set up Azure Cognitive Search to access storage:

    1.Navigate to your storage account in the Azure portal. Click on "Access control (IAM)" in the menu. Ensure the Cognitive Search managed identity has the "Storage Blob Data Contributor" role.
    2.Next, go to your Azure Cognitive Search service. Under "Settings," select "Identity" and confirm the managed identity is enabled. This setup allows Cognitive Search to securely access your storage resources.

    Further You can check:

    1.Verify the connection string used for Azure Blob Storage. Ensure it includes the correct account name and key.
    2.Check the network settings of the storage account. Ensure it allows access from Azure services, especially if there are virtual networks or firewall rules in place.
    3.If Azure AI Search uses a managed identity, confirm that this identity has the necessary permissions granted on the storage account.
    4.Review the UploadDocs.cmd script to ensure it has successfully created the margies container and uploaded the documents as intended.

    If you've verified all the above and are still encountering issues, it might be helpful to reconfigure the connection settings:

    1.Go to your Azure Blob Storage account.
    2.Check the Access keys (Settings > Access keys) and copy one of the keys.
    3.In Azure AI Search, when setting up the connection string, ensure you are using the correct key.

    Additionally, you can try resetting the connection:

    1.Delete the existing data source in Azure AI Search.
    2.Recreate the data source and ensure all connection details are correct.

    If the problem persists,
    Here are some links that might help resolve your issues.

    Video tutorial->Microsoft Learn AI Skills Challenge: Create an Azure AI Search solution: https://learn.microsoft.com/en-us/shows/learn-live/microsoft-learn-ai-skills-challenge-ep09-create-an-azure-ai-search-solution

    Some FAQ__:__ https://learn.microsoft.com/en-us/azure/search/cognitive-search-common-errors-warnings#error-could-not-execute-skill-because-web-api-skill-response-is-invalid

    Indexer troubleshooting guidance for Azure AI Search: https://learn.microsoft.com/en-us/azure/search/search-indexer-troubleshooting

    If the problem persists, please provide more details about the specific steps you took and any additional error messages you might have encountered.

    If you found the information helpful, we would greatly appreciate it if you could acknowledge it by selecting the Accept Answer & Upvote options.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.