VoiceRAG can be connected to existing Azure services, such as Azure OpenAI and Azure Search. This guide will show you how to reuse existing services in your Azure subscription.
Run these commands before running azd up
:
-
Run this command to ensure that the infrastructure does not make a brand new OpenAI service:
azd env set AZURE_OPENAI_REUSE_EXISTING true
-
Run this command to ensure that the infrastructure assigns the proper RBAC roles for accessing the OpenAI resource:
azd env set AZURE_OPENAI_RESOURCE_GROUP <YOUR_RESOURCE_GROUP>
-
Run this command to point the app code at your Azure OpenAI endpoint:
azd env set AZURE_OPENAI_ENDPOINT https://<YOUR_OPENAI_SERVICE>.openai.azure.com
-
Run this command to point the app code at your Azure OpenAI real-time deployment. Note that the deployment name may be different from the model name:
azd env set AZURE_OPENAI_REALTIME_DEPLOYMENT <YOUR_REALTIME_DEPLOYMENT_NAME>
If you are using the popular RAG solution azure-search-openai-demo, you can connect VoiceRAG to the existing index by setting the following azd
environment variables.
Run these commands before running azd up
.
-
Run this command to ensure that the infrastructure does not make a brand new Azure Search service:
azd env set AZURE_SEARCH_REUSE_EXISTING true
-
Run this command to ensure that the infrastructure assigns the proper RBAC roles for accessing the Azure Search resource:
azd env set AZURE_SEARCH_SERVICE_RESOURCE_GROUP <YOUR_RESOURCE_GROUP>
-
Run this command to point the app code at your Azure Search service:
azd env set AZURE_SEARCH_ENDPOINT https://<YOUR_SEARCH_SERVICE>.search.windows.net
-
Run these commands to point the app code at the existing index and fields:
azd env set AZURE_SEARCH_SEMANTIC_CONFIGURATION default azd env set AZURE_SEARCH_IDENTIFIER_FIELD id azd env set AZURE_SEARCH_CONTENT_FIELD content azd env set AZURE_SEARCH_TITLE_FIELD sourcepage azd env set AZURE_SEARCH_EMBEDDING_FIELD embedding azd env set AZURE_SEARCH_REUSE_EXISTING true azd env set AZURE_SEARCH_INDEX gptkbindex
-
(Optional) Run this command to disable vector search:
azd env set AZURE_SEARCH_USE_VECTOR_QUERY false
This variable is not needed if your search index has a built-in vectorizer, which was added to the
azure-search-openai-demo
index setup in the October 17, 2024 release.
Alternatively, you can first test the solution locally with the azure-search-openai-demo
index by creating a .env
file in app/backend
with contents like the following:
AZURE_TENANT_ID=<YOUR-TENANT-ID>
AZURE_OPENAI_ENDPOINT=https://<YOUR_OPENAI_ENDPOINT>.openai.azure.com
AZURE_OPENAI_REALTIME_DEPLOYMENT=gpt-4o-realtime-preview
AZURE_OPENAI_REALTIME_VOICE_CHOICE=<choose one: echo, alloy, shimmer>
AZURE_SEARCH_ENDPOINT=https://<YOUR_SEARCH_SERVICE>.search.windows.net
AZURE_SEARCH_INDEX=gptkbindex
AZURE_SEARCH_SEMANTIC_CONFIGURATION=default
AZURE_SEARCH_IDENTIFIER_FIELD=id
AZURE_SEARCH_CONTENT_FIELD=content
AZURE_SEARCH_TITLE_FIELD=sourcepage
AZURE_SEARCH_EMBEDDING_FIELD=embedding
Then follow the steps in the project's README to run the app locally.