Power automate batch transcription

This article describes how to use Power Automate and the Azure AI services for Batch Speech to text connector to transcribe audio files from an Azure Storage container. The connector uses the Batch Transcription REST API, but you don't need to write any code to use it. If the connector doesn't meet your requirements, you can still use the REST API directly.

In addition to Power Automate, you can use the Azure AI services for Batch Speech to text connector with Power Apps and Logic Apps.

Tip

Try more Speech features in Speech Studio without signing up or writing any code.

Prerequisites

Create the Azure Blob Storage container

In this example, you transcribe audio files that are located in an Azure Blob Storage account.

Follow these steps to create a new storage account and container.

  1. Go to the Azure portal and sign in to your Azure account.
  2. Create a Storage account resource in the Azure portal. Use the same subscription and resource group as your Speech resource.
  3. Select the Storage account.
  4. In the Data storage group in the left pane, select Containers.
  5. Select + Container.
  6. Enter a name for the new container such as "batchtranscription" and select Create.
  7. Get the Access key for the storage account. Select Access keys in the Security + networking group in the left pane. View and take note of the key1 (or key2) value. You need the access key later when you configure the connector.

Later you'll upload files to the container after the connector is configured, since the events of adding and modifying files kick off the transcription process.

Create a Power Automate flow

Create a new flow

  1. Sign in to power automate

  2. From the collapsible menu on the left, select Create.

  3. Select Automated cloud flow to start from a blank flow that can be triggered by a designated event.

    A screenshot of the menu for creating an automated cloud flow.

  4. In the Build an automated cloud flow dialog, enter a name for your flow such as "BatchSTT".

  5. Select Skip to exit the dialog and continue without choosing a trigger.

Configure the flow trigger

  1. Choose a trigger from the Azure Blob Storage connector. For this example, enter "blob" in the search connectors and triggers box to narrow the results.

  2. Under the Azure Blob Storage connector, select the When a blob is added or modified trigger.

    A screenshot of the search connectors and triggers dialog.

  3. Configure the Azure Blob Storage connection.

    1. From the Authentication type drop-down list, select Access Key.
    2. Enter the account name and access key of the Azure Storage account that you created previously.
    3. Select Create to continue.
  4. Configure the When a blob is added or modified trigger.

    A screenshot of the dialog to configure the blob trigger.

    1. From the Storage account name or blob endpoint drop-down list, select Use connection settings. You should see the storage account name as a component of the connection string.
    2. Under Container select the folder icon. Choose the container that you created previously.

Create SAS URI by path

To transcribe an audio file that's in your Azure Blob Storage container, you need a Shared Access Signature (SAS) URI for the file.

The Azure Blob Storage connector supports SAS URIs for individual blobs, but not for entire containers.

  1. Select + New step to begin adding a new operation for the Azure Blob Storage connector.
  2. Enter "blob" in the search connectors and actions box to narrow the results.
  3. Under the Azure Blob Storage connector, select the Create SAS URI by path trigger.
  4. Under the Storage account name or blob endpoint drop-down, choose the same connection that you used for the When a blob is added or modified trigger.
  5. Select Path as dynamic content for the Blob path field.

By now, you should have a flow that looks like this:

A screenshot of the flow status after create SAS URI.

Create transcription

  1. Select + New step to begin adding a new operation for the Azure AI services for Batch Speech to text connector.

  2. Enter "batch speech to text" in the search connectors and actions box to narrow the results.

  3. Select the Azure AI services for Batch Speech to text connector.

  4. Select the Create transcription action.

  5. Create a new connection to the Speech resource that you created previously. The connection is available throughout the Power Automate environment. For more information, see Manage connections in Power Automate.

    1. Enter a name for the connection such as "speech-resource-key". You can choose any name that you like.
    2. In the API Key field, enter the Speech resource key.

    Optionally you can select the connector ellipses (...) to view available connections. If you weren't prompted to create a connection, then you already have a connection that's selected by default.

    A screenshot of the view connections dialog.

  6. Configure the Create transcription action.

    1. In the locale field, enter the expected locale of the audio data to transcribe.
    2. Select DisplayName as dynamic content for the displayName field. You can choose any name that you would like to refer to later.
    3. Select Web Url as dynamic content for the contentUrls Item - 1 field. This is the SAS URI output from the Create SAS URI by path action.

    Tip

    For more information about create transcription parameters, see the Azure AI services for Batch Speech to text documentation.

  7. From the top navigation menu, select Save.

Test the flow

  1. From the top navigation menu, select Flow checker. In the side panel that appears, you shouldn't see any errors or warnings. If you do, then you should fix them before continuing.
  2. From the top navigation menu, save the flow and select Test the flow. In the window that appears, select Test.
  3. In the side panel that appears, select Manually and then select Test.

After a few seconds, you should see an indication that the flow is in progress.

A screenshot of the flow in progress icon.

The flow is waiting for a file to be added or modified in the Azure Blob Storage container. That's the trigger that you configured earlier.

To trigger the test flow, upload an audio file to the Azure Blob Storage container as described next.

Upload files to the container

Follow these steps to upload wav, mp3, or ogg files from your local directory to the Azure Storage container that you created previously.

  1. Go to the Azure portal and sign in to your Azure account.
  2. Create a Storage account resource in the Azure portal. Use the same subscription and resource group as your Speech resource.
  3. Select the Storage account.
  4. Select the new container.
  5. Select Upload.
  6. Choose the files to upload and select Upload.

View the transcription flow results

After you upload the audio file to the Azure Blob Storage container, the flow should run and complete. Return to your test flow in the Power Automate portal to view the results.

A screenshot of all steps of the flow succeeded.

You can select and expand the Create transcription to see detailed input and output results.

Next steps