In this demo, you’ll learn how to acquire an API key for your Azure OpenAI service and create an embedding model for your app. You’ll soon build an app that uses both vector and semantic search, so you need to create the necessary resources.
Start with the API key for your Azure Open AI service. Since you already have an Azure OpenAI resource, navigate to the Overview page of your OpenAI resource in the Azure portal. Click on Keys and Endpoint under Resource Management from the left menu. Here, you’ll see KEY 1 and KEY 2. Copy the value for KEY 1 — this will be your Azure OpenAI service key.
You can also find this key in the Azure OpenAI Studio. Navigate to it by visiting https://oai.azure.com/ from your logged-in browser, or click Go to Azure OpenAI Studio from the Overview page of your OpenAI resource in the Azure portal.
On the left side of the page are some navigational menus, while the center contains vital information about your Azure OpenAI service. Under Resource configuration, locate API key. This is the same key you copied from the Azure portal.
Note: This key is used to access your Azure OpenAI service APIs. Make sure you don’t expose it. Keep it somewhere safe.
Next, you’ll create a text embedding model. Your app will embed textual data, query with text, and retrieve text. It’s always a good idea to use the same embedding model for all these processes.
Still in Azure OpenAI Studio, locate the Shared resources section on the left menu, and click on Deployments. This opens up the Model deployments page in the main viewing area at the center of the page. Click on the Deploy model button below to create a model. It’ll open a dropdown, select Deploy base model.
In the dialog window that opens, search for text-embedding-3-large and select it. This is a text embedding model from OpenAI. Click on Confirm. It’ll open up another dialog window, where you get the chance to name your model. Name it text-embedding-3-large-kodeco-ai-new. Click Deploy to deploy your model.
You can create an index directly in your Azure portal and perform searches on it. Back in the Azure portal, go to your Azure AI Search resource.
On the Overview page, locate Import data at the top, beside Add index and click it.
On the page that opens, click the dropdown next to Data Source. Then, select Samples — this is a set of predefined data you can import to get started quickly with indexing. Choose any of the listed samples and click Next: Add cognitive skills (Optional) to continue.
At the bottom of the next tab that opens, you can skip the remaining options to move straight to the tab to customize your index. Here, you can give it a name besides the default, for easy identification. Click Next: Create an indexer to move to the final tab. Here, you can customize the indexer for your index. Then, click Submit to create the index.
When you become familiar with the format of the index data, you can create one manually. Under Search management on the left menu, click on Indexes. Click the Add index dropdown, followed by the Add index (JSON) option to create an index.
A panel opens on the right side of the screen, showing a JSON editor. You can edit it and click the Save button below to create your index.
Note: Remember to delete your index if you won’t be using it.
That’s all for this demo! Continue to learn more about vector search in Azure AI Search.