How do I configure Azure Cognitive Search datasource to connect using service principal?

Hefner, Craig 0 Reputation points
2023-03-30T21:43:17.9+00:00

I am moving from SQL server to Synapse and need to connect my data source in Cognitive Search using a service principal. I do not see an option for this. Is it possible?

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
724 questions
Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,402 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Grmacjon-MSFT 16,191 Reputation points
    2023-03-30T23:25:41.53+00:00

    Hi @Hefner, Craig

    Thanks for the question. Yes, it is currently possible to connect your data source in Cognitive Search using a service principal. You can use Azure Active Directory (Azure AD) authentication with Cognitive Search to create and use service principals for authenticating data sources.

    To create a service principal, you will need to follow these high-level steps:

    1. Register an application in Azure AD
    2. Create a client secret for the application
    3. Grant the necessary permissions to the application in Azure AD
    4. Use the application's credentials to connect to the data source in Cognitive Search

    Here are some more detailed steps to follow:

    1. Register an application in Azure AD: a. Go to the Azure portal and open the Azure AD tenant where you want to register the application. b. Select "App registrations" and then click "New registration". c. Provide a name for the application and select the appropriate options for the supported account types and redirect URIs. d. After the registration is complete, note down the application ID.
    2. Create a client secret for the application: a. In the application overview page, click "Certificates & secrets" and then click "New client secret". b. Enter a description for the secret, select an expiration time, and click "Add". c. Note down the value of the client secret.
    3. Grant the necessary permissions to the application in Azure AD: a. In the application overview page, click "API permissions" and then click "Add a permission". b. Select the appropriate APIs and permissions for your data source. c. After selecting the APIs and permissions, click "Grant admin consent for {your tenant name}".
    4. Use the application's credentials to connect to the data source in Cognitive Search: a. In the Cognitive Search portal, go to your data source and click "Connect". b. Select "Azure AD" as the authentication type and enter the application ID, client secret, and tenant ID. c. Test the connection to ensure that it works properly.

    You can find more information on using service principals for authentication in Azure Cognitive Search in the following documents:

    Hope that helped.

    -Grace


    If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.


  2. Grmacjon-MSFT 16,191 Reputation points
    2023-04-03T19:33:18.9933333+00:00

    Hi @Hefner, Craig thanks for your patience. We heard back from the ACS engineering team. They confirmed that Synapse is currently not supported directly as a data source for pull indexers. This is probably why step 4 in my first response did not work. You can find a list of supported data sources is here:
    https://learn.microsoft.com/en-us/azure/search/search-data-sources-gallery As a workaround, they suggested using Push API instead if you would like to index from Synapse
    https://learn.microsoft.com/en-us/azure/search/search-what-is-data-import If you have further questions please let us know :) -Grace

    0 comments No comments