- Create an Azure account with an active subscription. For details, see Create an account for free
- Create an Azure Communication Services resource. For details, see Create an Azure Communication Resource. You'll need to record your resource connection string for this sample.
- An Calling-enabled telephone number. Get a phone number.
- Azure Dev Tunnels CLI or another method to tunnel back to your local computer. For details, see Enable dev tunnel
- An Azure OpenAI Resource and Deployed Realtime Model. See instructions.
Before running this sample, you'll need to setup the resources above with the following configuration updates:
Azure DevTunnels is an Azure service that enables you to share local web services hosted on the internet. Use the commands below to connect your local development environment to the public internet. This creates a tunnel with a persistent endpoint URL and which allows anonymous access. We will then use this endpoint to notify your application of calling events from the ACS Call Automation service.
devtunnel create --allow-anonymous
devtunnel port create -p 5165
devtunnel host
Open the Properties\launchSettings.json file to configure the following settings:
- `VS_TUNNEL_URL`: your dev tunnel endpoint
- `applicationUrl`: the localhost port that your local app is running on
Open the appsettings.json
or add an appsettings.Development.json
file to configure the following settings:
- `AcsConnectionString`: Azure Communication Service resource's connection string.
- `AzureOpenAIServiceKey`: Open AI's Service Key
- `AzureOpenAIServiceEndpoint`: Open AI's Service Endpoint
- `AzureOpenAIDeploymentModelName`: Open AI's Model name
- `SystemPrompt`: Optionally override the AI default system prompt
- Azure DevTunnel: Ensure your AzureDevTunnel URI is active and points to the correct port of your localhost application
- Run
dotnet run
to build and run the sample application - Register an EventGrid Webhook for the IncomingCall Event that points to your DevTunnel URI. Instructions here.