How to connect to Azure Cognitive search from Angular application using managed identity

Debashis Jena 76 Reputation points
2023-04-28T10:08:41.6733333+00:00

We have a angular UI application which is deployed in Azure app service. We want to connect to Azure cognitive search via managed identity from angular application.

Please suggest any procedure or documentation on how to connect to Azure search using managed identity.

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.
1,349 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,952 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 14,180 Reputation points MVP
    2023-04-28T13:33:02.3866667+00:00
    • First Set up managed identity for your Azure App Service:

    https://learn.microsoft.com/en-us/azure/app-service/overview-managed-identity?tabs=portal%2Cdotnet

    • Grant the managed identity access to your Azure Cognitive Search service

    Azure Cognitive Search > Access control (IAM) > Add role assignment > Cognitive Search Data Reader

    • You'll need a back-end service that can handle requests from your Angular application and interact with Azure Cognitive Search using managed identity. You can create a simple API using Node.js, ASP.NET, or any other back-end framework.
    • Use Azure Active Directory (Azure AD) to secure your back-end service

    https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-configure-app-access-web-apis

    • Implement search functionality in your back-end service. You can use REST API to interact with your search service

    https://learn.microsoft.com/en-us/rest/api/searchservice/

    • Call your back-end service from the Angular application

    Use HttpClient https://angular.io/guide/http and follow

    https://learn.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-javascript-auth-code-angular


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.