Items marked (preview) in this article are currently in public preview. This preview is provided without a service-level agreement, and we don’t recommend it for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
Prerequisites
- Get Microsoft Teams Calling Plan phone numbers for your tenant.
- Follow the setup for Teams Phone System extensibility.
- A saved voice-first agent in a Foundry project that passes browser testing. See Quickstart: Create a voice-first prompt agent.
- Foundry User role on the project, to create and manage telephony bindings.
The Foundry RBAC roles were recently renamed. Foundry User, Foundry Owner, Foundry Account Owner, and Foundry Project Manager were previously named Azure AI User, Azure AI Owner, Azure AI Account Owner, and Azure AI Project Manager. You might still see the previous names in some places while the rename rolls out. The role IDs and core permissions are unchanged by the rename.
- Permission to update the agent and its channels.
- Access to the selected Azure Communication Services resource.
- Permission to create or update a Foundry project connection.
- Permission to create or update telephony bindings.
- Event Grid write permission on the Azure Communication Services resource.
- Help from a tenant administrator when secure webhook setup requires Microsoft Entra application or app-role changes.
Twilio prerequisites
For the Twilio path, you need:- A Twilio account with at least one active, voice-capable phone number.
- The Twilio Account SID and Primary Auth Token if you need to create a Foundry project connection.
- Permission to create or read connections in the Foundry project.
- Permission to create telephony bindings for the agent.
Understand the call path
The channel integration determines how an inbound call reaches the agent.- A caller dials the Teams phone number.
- Teams routes the call to your resource account.
- The resource account routes the call to your Communication Services resource.
- Communication Services raises a
Microsoft.Communication.IncomingCallevent through Event Grid to your agent’s telephony callback endpoint. - Foundry matches the callee to a telephony binding, answers the call on your Communication Services resource, and streams the audio to the agent.
Compare the channel integrations
Direct SIP and Azure Communication Services purchased numbers aren’t supported customer options in the current Add a number menu. The Twilio option appears only in supported public-cloud environments.
Understand telephony bindings
A telephony binding connects a provider-specific destination to one voice agent in your project. For a Teams Phone REST binding, setprovider to teams_phone_extension and pass the resource account GUID in resource_account_object_id. The incoming-call identifier 28:orgid:{resource-account-guid} isn’t the value of that REST property.
A binding holds:
- A service-generated binding
id. - The provider and its destination, such as the Teams resource account object ID.
- A
statusofactiveorsuspended, which lets you take a number offline without deleting the mapping. - A
connectionthat names the Foundry project connection for your provider. Secrets aren’t stored in the binding itself. - An
incoming_call_urlthat the service generates for incoming-call delivery.
{projectEndpoint}/agents/{agentName}/telephony/bindings. To get, update, or delete one binding, append /{bindingId}.
Binding reads return an ETag. Send that value in If-Match when updating or deleting the binding to avoid overwriting a concurrent change. Transfer targets are configured separately for the agent, not on each binding.
Prepare Microsoft Teams Phone Extensibility
A Teams or Microsoft 365 administrator usually completes these steps.- Follow Teams Phone System extensibility quick start to provision the application, bot, resource account, and Azure Communication Services association.
- Create or select the Azure Communication Services resource that receives calls for the resource account.
- Create the Teams resource account with the Phone Extensibility application ID.
- Associate the resource account with the Azure Communication Services resource, and synchronize the resource account.
- Acquire a Teams service number and assign it to the resource account. The number can use Calling Plan, Operator Connect, or Direct Routing according to your Teams telephony configuration.
- Assign the Microsoft Teams Phone Resource Account license when required.
- Provide Azure Communication Services server consent for the exact tenant and resource-account object ID.
- Place a controlled call and confirm that Azure Communication Services emits
Microsoft.Communication.IncomingCall.
- The callable Teams number.
- The Azure Communication Services ARM resource ID.
- The resource-account object ID.
- Confirmation that Azure Communication Services received the test call.
Configure transfer to a person
An agent that can’t complete a request should reach a human rather than end the call. Configure named transfer targets for the agent. These targets are separate from its telephony bindings. First, read the current target list and itsETag response header:
PUT, using the returned ETag in If-Match. Include every target you want to keep: this operation replaces the entire list, and an empty array clears it.
teams destination can be a Teams user, or the resource account of a call queue or auto attendant. That’s how a voice agent hands a caller back into an existing Teams call flow.
Give each target a description that says when to use it. The agent chooses based on that text.
Transfer requests select a target from the agent’s configured list rather than supplying an arbitrary destination.
Manage a live call
List the agent’s calls, and use the service-generated callid as {callId} in subsequent requests:
operator target:
GET {projectEndpoint}/agents/{agentName}/telephony/calls/{callId}?api-version=v1.
Configure audio for phone calls
Phone networks carry narrowband audio, so tune the agent for the channel:- Set
noise_reductiontoazure_deep_noise_suppressionfor contact center traffic. - Increase
silence_duration_ms. Callers on a phone pause more than callers at a keyboard. - Add
phrase_listhints for the identifiers callers read aloud, such as order or policy numbers. - Attach the
end_conversationsystem tool so the agent can end a completed call.
Test the call
- Wait for the selected provider and binding changes to propagate. For Microsoft Teams, also allow time for Azure Communication Services and Event Grid propagation.
- From a controlled caller, call the configured number.
- Confirm the agent answers.
- Complete a short conversation.
- Interrupt the agent.
- Use one safe tool or knowledge path.
- Test the approved human-handoff behavior.
- End the call.
- Confirm that monitoring and trace data appear.
- Test timestamp and time zone.
- Called number.
- Callee identifier.
- Telephony provider and provider call ID, such as an Azure Communication Services correlation ID or Twilio Call SID.
- Agent name and version.
- For Microsoft Teams, the Azure Communication Services resource ID and Event Grid delivery result.
- For Twilio, the Foundry project connection name.
Trace phone calls
When a call arrives through telephony, the session’s root trace span records the provider, the provider’s call ID, and the dialed and calling numbers. You can correlate a Foundry session with a record in your telephony provider. Caller and callee phone numbers are personal data. Review who can read your project’s Application Insights resource before you enable content capture. See Voice agent tracing, monitoring, and evaluation.Troubleshoot telephony
Disconnect a number
Disconnecting removes the Foundry binding. It doesn’t:- Release the Teams or Twilio number.
- Remove the Teams resource account.
- Delete Azure Communication Services.
- Remove the bot or app registration.
- Revoke Teams Phone Extensibility consent.
- Delete the Twilio account or the Foundry project connection.
Security checklist
- Use Microsoft Entra authentication and managed identities.
- Don’t share Azure Communication Services keys, connection strings, tokens, bot secrets, or portal cookies.
- Don’t share Twilio Account SIDs together with Auth Tokens, and rotate an Auth Token if it is exposed.
- Validate that the Event Grid topic is the intended Azure Communication Services resource.
- Use the exact public Foundry project webhook endpoint.
- Keep webhook audience and Event Grid delivery identity concepts separate.
- Use a dedicated single-tenant webhook application when governance requires it.
- Don’t persist service-generated call callback or media tokens.
- Confirm the binding target before update or deletion.
- Apply recording, consent, disclosure, retention, and privacy requirements.
- Prevent sensitive caller data from being read aloud or unnecessarily stored.