Azure-Samples / azure-search-openai-demo

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
https://azure.microsoft.com/products/search
MIT License
6.33k stars 4.23k forks source link

Connect AI Search to AI Studio Hub #1784

Closed phoevos closed 4 months ago

phoevos commented 4 months ago

I am creating a hub and a project on AI Studio and I'd like to add a connection to Azure AI Search.

I understand that key-based authentication was disabled for the Search service as a security optimisation. However, API key authentication is the only method exposed through the AI Studio UI when creating a connection. At the same time, I see that the free tier for Search does not support managed identity. What can I do about this?

I'm not limited by what's exposed through AI Studio since I'm using Bicep for the deployment anyway. I'm just using the UI for reference, given that it's hard to tell what's actually supported for each kind of service/connection.

cforce commented 4 months ago

AFAIK AI studio chat bot creation is sundowned. Better understand the code and stick with you keyboard but mouse. It’s because the whole setup is still evolving to fast, so simple solutions are still not there:/

phoevos commented 4 months ago

This is how I'm setting up the hub/connections/project through Bicep:

resource aiHub 'Microsoft.MachineLearningServices/workspaces@2024-04-01' = {
  name: aiHubName
  location: location
  tags: tags
  identity: { type: managedIdentity ? 'SystemAssigned' : 'None' }
  properties: {
    keyVault: keyVaultId
    storageAccount: storageAccountId
    containerRegistry: containerRegistryId
    applicationInsights: applicationInsightsId
  }
  kind: 'hub'

  resource aiServicesConnection 'connections' = {
    name: '${aiHubName}-connection-oai'
    properties: {
      category: 'AzureOpenAI'
      target: aiServicesTarget
      authType: 'AAD'
      isSharedToAll: false
      metadata: {
        ApiType: 'Azure'
        ResourceId: aiServicesId
      }
    }
  }

  resource aiSearchConnection 'connections' = {
    name: '${aiHubName}-connection-search'
    properties: {
      category: 'CognitiveSearch'
      target: aiSearchTarget
      authType: 'AAD'
      isSharedToAll: false
      metadata: {
        ApiType: 'Azure'
        ResourceId: aiSearchId
      }

    }
  }
}

resource aiProject 'Microsoft.MachineLearningServices/workspaces@2024-04-01' = {
  name: aiProjectName
  location: location
  tags: tags
  identity: { type: managedIdentity ? 'SystemAssigned' : 'None' }
  properties: {
    hubResourceId: aiHub.id
  }
  kind: 'project'
}

The Search connection is created as seen below: image

When I navigate to the Chat > Add your data tab though, the index is not there: image

If I follow the instructions in the Add a new data source form, I get a cryptic error: image

How do I debug this? Is there anything else I need to configure for the AAD connections to work?

pamelafox commented 4 months ago

It looks like you are trying to use the On Your Data feature. That is not used by this repo. The closest repo is https://github.com/microsoft/sample-app-aoai-chatGPT since that is the code behind the On Your Data deployable app.

However, for issues specific with AI Search, they recommend filing a support ticket with the service. Do you see an option in the Portal to file a support ticket?

I am closing this issue, since it's not something resolvable in this codebase.