One-click deploy Azure Solution Accelerator for Call Center Automation with OpenAI Realtime Models and Azure Communication Services. This Solution Accelerator provides a reference implementation for an AI-assisted call center solution that uses Azure Communication Services to provide a phone-based voice channel for customers to interact with an AI Agent.
- Directly talk to the AI Agent through the web interface
- Request a phone call to talk to the AI Agent via telephone
- Speaks multiple languages
- Ask questions about Azure products
- Interrupt the bot anytime
- Customizable knowledge base and system prompt
For this demo, the bot is able to answer questions about Microsoft Azure products, like Azure App Service, Azure Container Apps, and Azure Container Registry but its knowledge can be customized. Here is some inspiration for questions you can ask the bot:
Which pricing tier of Azure App Service supports custom domains?
What is the difference between scaling up and scaling out in Azure App Services?
To run this application, you can provision the resources to your Azure Subscription using the Azure Developer CLI.
From your command line:
# Login to the Azure Developer CLI
azd auth login
# Provision all the resources with the azure dev cli
# The following values should work:
# location=northeurope
# aiResourceLocation=swedencentral
azd upAt the moment, the configuration of Azure Communication Services phone number is not automated. So you will need to follow the following steps manually.
- Go to the Azure Portal and navigate to the Azure Communication Services resource that has been created
- In the left menu, select Phone numbers and then click the Get button
- Select a Country or region and choose Toll free as your number type
- Follow the instructions to purchase a phone number
- Add an
ACS_SOURCE_NUMBER=xxxenvironment variable to the.azure/xxx/.envfile with the phone number
To deploy the application, you can use the script provided in the azd-hooks folder. This script will build and deploy the user interface and the backend API. Before running the script, make sure you have the Azure CLI and the Azure Communication Services extension installed.
az extension add --name communicationRun the script with the following commands:
# Get and set the value for AZURE_ENV_NAME
source <(azd env get-values | grep AZURE_ENV_NAME)
# Building and deploying the user interface and the backend API
bash ./azd-hooks/deploy.sh app $AZURE_ENV_NAMEWhen successful, you will see the following output with the URL of the deployed application:
Deployment complete. Application URI: <YOUR_APP>.azurecontainerapps.io
To enable inbound calls, you will also need to add a Web Hook to the Event Grid System Topic resource.
- Go to the Azure Portal and navigate to the Event Grid System Topic resource that has been created
- In the left menu, select Event Subscription and then click the + Event Subscription button
- Give a name to the event subcription, e.g.
receive-call - In the dropdown list Filter to Event Types, select Incoming Call
- Set Endpoint Type to Web Hook
- Click Configure an endpoint, add
https://<YOUR_APP>.azurecontainerapps.io/acs/incoming, and click Create
Running this application locally, still requires some Azure Services in the cloud, so make sure to set up the Azure environment first.
We use ngrok to tunnel localhost to a publically available URL while developing. This is needed, as Azure Communication Services need a URL for the callbacks and to send the voice packages to. This can not be localhost and must be reachable from Azure Communication Services. For the first time, you might need to install ngrok and create a free account.
Start the ngrok server.
ngrok http http://localhost:8765This will create a public URL that tunnels to your localhost. You will see an output like this:
Forwarding https://1234-567-123-456-789.ngrok-free.app -> http://localhost:8765
Note the public domain (in this case 1234-567-123-456-789.ngrok-free.app), as you will need it later to set the environment variables.
If you are running this application locally, for the first time, we recommend setting up a Python environment. This only needs to be done once.
python -m venv .venvActivate the local Python environment.
source .venv/bin/activateInstall the packages
pip install -r src/app/requirements.txtSet the environment variables.
source <(azd env get-values)
azd env get-values > .envOverride the callback urls with your ngrok domain (Example: 1234-567-123-456-789.ngrok-free.app)
For Bash:
export ACS_CALLBACK_PATH="https://<YOUR_NGROK_DOMAIN>/acs"
export ACS_MEDIA_STREAMING_WEBSOCKET_PATH="wss://<YOUR_NGROK_DOMAIN>/realtime-acs"For PowerShell:
setx ACS_CALLBACK_PATH="https://<YOUR_NGROK_DOMAIN>/acs"
setx ACS_MEDIA_STREAMING_WEBSOCKET_PATH="wss://<YOUR_NGROK_DOMAIN>/realtime-acs"Start the application
python src/app/app.pyTo make inbound calls work for local development, you need to set up another Event Grid System Topic and set the Web Socket endpoint to your ngrok domain (e.g. https://1234-567-123-456-789/acs/incoming).
You can customize the knowledge base and the system prompt of the bot.
The knowledge base is stored in the data folder. After running the deployment script, the contents of this folder will be copied to the Azure Storage Account from where it is indexed and vectorized in the Azure AI Search service.
To customize the knowledge base, you can add or remove files from the data folder and re-run the deployment script.
By default, the hardcoded system prompt is used. You can customize the system prompt by placing a file named system_prompt.md in the prompt container of the Azure Storage Account. If this file exists, it will be used instead of the hardcoded system prompt.
(alphabetical order)
- Carlos Raul Garcia
- Sasa Juratovic
- Richard Lagrange
- Thibo Rosemplatt
- Sanjay Singh
- Robin-Manuel Thiel
- Yimi Wang
Based on this solution accelerator: on-the-road copilot
Trademarks: This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft’s Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party’s policies.

