Play secure audio file from Copilot Studio

Applies to: Dynamics 365 Customer Service

Important

Power Virtual Agents capabilities and features are now part of Microsoft Copilot Studio following significant investments in generative AI and enhanced integrations across Microsoft Copilot.

Some articles and screenshots may refer to Power Virtual Agents while we update documentation and training content.

For customer voice solutions, if the organization wants to play their custom audio clips that they play through their Interactive Voice Response (IVR), they must use secure storage.

Note

This article refers to Copilot Studio classic for voice support.

This can be achieved with Azure Blob Storage but by default, Azure Blob storage URLs contain values that are filtered out by security scanning code when passed between systems.

Prerequisites

Solution

  • Utilize Azure Blob storage to host audio files for playback through SSML
  • Encode the URLs such that they meet content security scan requirements for Microsoft systems.

Steps to Create Storage Account and secure audio file:

  1. Sign in to your Azure account (sign-up link)

  2. Create an Azure Storage account

  3. When provisioning:

    1. uncheck the box for Allow enabling public access on individual containers to ensure only URLs with secure access tokens are allowed

    Screenshot of the Create a storage account screen, with the Advanced tab and Allow enablic public access option being highlighted.

    1. Leave the Enable public access from all networks selected

    Screenshot of the Create a storage account screen with the Networking tab and Enable public access option being highlighted.

  4. Once created, create a blob storage container under Containers

  5. Upload audio files as blobs to the container

  6. Double click on an uploaded audio file row in container view, and navigate to Generate SAS

  7. Set an expiration time, and then choose Generate SAS token and URL.

  8. Copy the Blob SAS URL

  9. Before pasting into Copilot Studio, one more step is needed which is to encode the URL. Replace all & characters with & to make it safe to pass through the Copilot Studio system.

Tip

The expiration time will determine when the system will stop being able to play back this audio file; please be careful when choosing this datetime.

Steps to use audio file from secure storage:

  1. Open your custom Copilot Studio in Bot Framework composer.

  2. Open your Bot in Copilot Studio.

  3. Go to Topics, New topic and finally Open in Bot Framework Composer.

Screenshot of the Power Virtual Agents screen with the Topics tab, New topic option, and Open in Bot Framework Composer option being highlighted.

  1. Once Bot Framework Composer is open, add a new dialog to your Bot.

Screenshot of the Play Audio Secure File screen with the Add a dialog option being highlighted.

  1. With the new dialog created, choose BeginDialog.

Screenshot of the PlayAudioSecureFile screen with the Play Audio and Begin Dialog options being highlighted.

  1. In the edit panel, add a new event Send a response.

Screenshot of the Begin Dialog screen with the Send a response option being highlighted.

  1. Add speech component to your bot response. Learn more at Add speech components to your bot responses.

  2. After choosing audio option, copy/past your secure URL generated above to the "URL" tag.

Screenshot of a text input field, with the text U R L being highlighted.

  1. Finally save and publish your Copilot Studio classic bot.