RAG with Azure AI Search

Nov 15 2024 · Python 3.12, Microsoft Azure, JupyterLab

Lesson 01: RAG with Azure AI Search

Demo 01

Episode complete

Play next episode

Next
Transcript

You can use Azure AI Search through the Azure portal, REST APIs, or SDKs. The Azure portal is a website that provides a management interface for all things on the Azure platform. To get started, visit https://azure.microsoft.com/free/ to sign up for a free account. As a new user, you can use the platform for free for a limited period. There are, however, a few services that are always free, and others which need higher subscription tiers to use.

After signing up, you’re redirected to the Azure portal. This portal offers every tool you need to manage your Azure account. All the features are arranged into five main groups. Here’s a brief overview:

  • To the top left corner is a hamburger menu. Click it to open. This shows all major destinations on the Azure platform. It features the home screen, a dashboard that you can customize to your taste, and a few select services you’re likely to use often.

  • Back to the home screen — you have a navigation bar in blue at the top of the page. The most prominent feature here is the search box. It allows you to search for every resource, service, or even document on the Azure portal. To the right of that bar are menu items for managing your account.

  • The first rows in the home screen’s main content area show a few common features to navigate. The most prominent of these is the “Create a resource” button.

  • Below this row is a list of resources you’ve created. It provides a quick way to access them.

  • The last category, at the bottom half of the page, shows even more useful links, such as the documentation, cost management, and subscriptions.

For this module, you’ll need an Azure AI Search resource, an Entra ID, an Azure OpenAI resource, and an embedding model.

For now, you’ll create the Search and the OpenAI resources. Click Create a resource to create an Azure AI Search resource, or type it in the search bar and select the option under Marketplace. Leave the subscription as the default. Create a new resource group called Movies_AI. A resource group creates a bucket that helps you identify each resource and what it’s created for. Make sure to always choose a descriptive name, as the same applies to all resources you’ll be creating.

Note that not all features, products, and services are available for all regions and subscriptions. Visit https://learn.microsoft.com/en-us/azure/search/search-region-support to find out about the supported regions, and https://azure.microsoft.com/en-us/support/plans to find out what’s possible with each type of subscription.

For the name of your service, enter movies-ai-search. Leave the Location as the default. Note that this location must be the same for the Azure OpenAI resource you’ll be creating next. Click Review + create at the bottom of the page to skip the remaining steps and then click Create to create the resource. Select the Go to resource button, which defaults to the Overview page. At the far right, locate the Url and copy it. This will be your Azure Search Service URL.

Under Settings on the menu on the left side of the page, select Keys. Under API Access Control, select Both, to enable both API keys and Role-Based Access Control (RBAC) for the resource. Under the same Settings menu, select Identity. In the page that opens, enable Status under the System assigned tab and save. This grants permission to the system-assigned managed entity on this resource.

Finally, go to Access Control (IAM) on the left menu. Here, you’ll grant a set of permissions to your user account: Search Index Data Contributor, Search Index Data Reader, and Search Service Contributor. At the top, click the Add button, and select Add role assignment. In the search box below, search for the first role: Search Index Data Contributor, and select it. Click Next. Under the Members tab, click Select members. In the window that opens, select your user account and click Select at the bottom of that window. Now, click Review + assign to complete the process. Complete the process for the two remaining roles. Back at the Check access tab on the Access control (IAM) page, click the View button under View access to this resource to see the list of roles assigned to this resource.

That’s all for the Azure Search service for now!

See forum comments
Cinema mode Download course materials from Github
Previous: Instruction 01 Next: Instruction 02