Get started with voice agents in Microsoft Foundry

Image of Anton.
Hi, I’m Anton.
I’ll be here to help you with hints and tips as you work through this lab; in which you’ll configure a voice agent in Microsoft Foundry. You’ll learn how to set up listening and speaking layers, write instructions optimized for voice, and test your agent with realistic scenarios.

If you want more interactive help, you can chat with me in the Ask Anton app.

Ask Anton is a generative AI agent that can answer questions about AI concepts and Microsoft Foundry technologies. It's available in two versions at https://aka.ms/choose-anton:
  • Azure-based: Best experience (requires an Azure subscription and deployment of a model in a Foundry project).
  • Browser-based: Use a small language model in your browser (reduced functionality - may be slow or work only in "basic" mode in older/lower-spec devices).
Ask Anton is not a supported Microsoft product or a component of Microsoft Learn or AI Skills Navigator.

This exercise should take approximately 30 minutes to complete.

Note: Many components of Microsoft Foundry, including the Microsoft Foundry portal, are subject to continual development. This reflects the fast-moving nature of artificial intelligence technology. Some elements of your user experience may differ from the images and descriptions in this exercise!

Create or open a Microsoft Foundry project

Microsoft Foundry uses projects to organize models, resources, data, and other assets used to develop an AI solution. You’ll need a project to create your voice agent.

  1. In a web browser, open Microsoft Foundry at https://ai.azure.com and sign in using your Azure credentials. Close any tips or quick start panes that are opened the first time you sign in, and if necessary use the Foundry logo at the top left to navigate to the home page.
  2. If you do not have any existing projects, you may be prompted to create one. If so, create a new project with a unique name; expanding the Advanced options area to specify the following settings for your project:
    • Foundry resource: Enter a valid name for your AI Foundry resource.
    • Subscription: Your Azure subscription
    • Resource group: Create or select a resource group
    • Region: Select any of the AI Foundry recommended regions in this list

    Image of Anton.
    Tip: Depending on your permissions in the Azure subscription, you may need to clear the option to set up recommended resources.

  3. Wait for your project to be created, and close any welcome dialogs that are displayed. It may take a few minutes. After creating or selecting a project in the new Foundry portal, it should open in a page similar to the following image:

    Screenshot of the Foundry project home page.

Create a voice agent

Now you’ll create a voice-based agent for a customer support scenario.

  1. On the Build page, select the Agents tab, then select Build an agent.

  2. Enter a name for your agent, such as customer-support-agent.

  3. Select Voice as the Interaction mode and enter a goal for the voice agent, such as “Provide customer support for Contoso Shop and help customers with online returns.”

    Screenshot of creating a new voice agent.

  4. Select Create agent and open playground.

    Your agent opens in the agent playground.

Configure the instructions

Voice agents need instructions written for spoken conversation, not text. Replace the template instructions with ones optimized for speech.

  1. In the Instructions panel, update the personality section with the following content:

     ### Personality
    
     You are Alex, a helpful return-policy information assistant for Contoso Shop. You explain return-policy terms clearly and patiently, and are honest when the policy details are unavailable or unclear. You do not process returns, approve refunds, or make exceptions.
    
  2. In the Instructions panel, update the guardrails section with the following content:

     ### Guardrails
    
     - Never share account details before the caller verifies their identity
     - Stay in scope: explain return-policy information only.
    - State only what you can verify; never invent eligibility, deadlines, fees, refund amounts, or exceptions.
    - Do not promise a return, refund, exchange, approval, or timeline.
    - Hand off to a human when asked or when you cannot resolve the question.
    - Reply in the language the caller requests or, without a stated preference, the language they use. Follow clear language changes, not isolated foreign words or names. When uncertain, keep the current language and briefly clarify if needed.
    
  3. Select Save to save your instructions.

Configure the audio input

Configure how your agent hears and understands callers.

  1. Scroll down to the Advanced settings button and select it.
  2. Under Input:
    • User transcript model: Verify Azure Speech is selected for reliable, fast transcription.
    • Language: Verify Auto-detect is selected to support multiple languages.
  3. Under Automatic turn detection:
    • Verify Azure Semantic Multilingual is selected for conversational scenarios. This understands when a caller finishes speaking, not just silence.

    Image of Anton.
    Tip: Turn detection is critical. If it’s too aggressive, your agent interrupts callers. Too passive, and it waits awkwardly. The semantic mode handles natural pauses in speech better.

  4. Under Audio enhancement:
    • Ensure Noise suppression and Echo cancellation are both enabled to handle real-world phone environments.
  5. Under Conversational behavior
    • Select Interim response.
    • Select LLM-generated messages.

    Image of Anton.
    Tip: Interim responses are crucial if your agent calls tools that take more than 1.5 seconds. Without them, callers think the call dropped during the silence.

  6. Use Select to save your changes.

    Screenshot of the advanced voice agent settings.

Configure the audio output

Now configure how your agent sounds and handles latency.

  1. Under Voice select the configuration button near the selected voice to open the advanced voice options.

  2. In the Advanced voice options:
    • Voice: Select a standard Azure voice (e.g., “Ash” or “Alloy”). Preview it to make sure it sounds clear and professional.
    • Playback speed: Leave at 1.0 (normal speed).
  3. Use Select to save your changes.

Test your voice agent in the playground

Now it’s time to test your agent. Currently, your agent doesn’t have a knowledge base configured with a return policy, so it will rely solely on the instructions and tools you’ve configured. You can try various scenarios to see how it responds.

  1. At the top of the playground, select Start session and allow microphone access when prompted.

  2. Test these scenarios (speak naturally, as if calling customer support):
    • Greeting test: Let the agent greet you. Does it sound natural?
    • Turn detection test: Ask a question, pause for 2–3 seconds mid-sentence, then continue. Does the agent wait patiently without interrupting?
    • Interruption test: While the agent is speaking, start talking. Does the agent recognize you and stop?
    • Clarity test: Say something ambiguous like "I have a problem with my order." Does the agent ask for clarification instead of guessing?
  3. After testing, select End session.

Image of Anton.
Tip: For a more robust experience, you can try configuring a knowledge base with a return policy and see how the agent responds to related queries.

Summary

You’ve successfully built a voice agent by configuring three critical layers:

  • Reasoning: Instructions optimized for speech that guide the agent’s behavior.
  • Listening: Transcription and turn detection so the agent hears and understands callers.
  • Speaking: Voice and interim responses so the agent sounds natural and responsive.

Voice agents excel when all three layers work together. The insights you gained from testing and tracing your agent—recognizing turn detection latency, transcription misses, and latency issues—are the same skills you’ll use to optimize production voice agents.

Clean Up

If you’ve finished exploring Microsoft Foundry, delete the resources created in this exercise to avoid unnecessary charges.

  1. Open the Azure portal at https://portal.azure.com and view your resource group.
  2. On the toolbar, select Delete resource group.
  3. Enter the resource group name and confirm deletion.

Anton avatar.
If you used the Ask Anton app during this lab, we’d love to hear about your experience!