Power Community

Power Community

Connecting to Azure OpenAI Whisper Service in Power Automate

Table of Contents

  • An Azure Subscription with Azure OpenAI Service
  • Power Automate Premium
  • Step 1: Create Azure OpenAI Service in Azure
    • Retrieve Service Endpoint URI and Key (either Key 1 or Key 2)
  • Step 2: Create a Whisper Deployment
    • Retrieve Deployment Name
  • Step 3: Create an HTTP Flow in Power Automate
  • Navigate to the Azure portal and create a new OpenAI service. Select the appropriate subscription and resource group, and ensure you choose a supported region
  • As of this writing (12 May 2024), the currently supported regions are: East US 2, South India, North Central US, Norway East, Sweden Central, and West Europe.

Create Azure OpenAI Service

1. In Azure, search for Azure OpenAI Service then click create.

cha_cha_3-1715491793280.png

cha_cha_4-1715491856504.png

2. Follow the following settings. I am using South India since that is the closest regional location for my case. Once done, click Review + Create and wait for it to be completed.

cha_cha_1-1715486758923.png

Copy a Key and the Endpoint URI

1. Once the resource has been created, head over to the Resource > {the resource you just created} > Keys and EndPoint

cha_cha_0-1715491284795.png

Once your Azure OpenAI service is set up, you need to create a Whisper deployment. This is your dedicated instance for handling audio transcriptions and translations.

1. Navigate to https://oai.azure.com/portal and select the Resource that you have created in step 1.

2. Navigate to Deployments then select Create new deployment

cha_cha_0-1715491527019.png

3. Put the following settings for the deployment then click Create.

cha_cha_1-1715491642105.png

cha_cha_2-1715491708970.png

Open Power Automate and create a new flow using the HTTP request trigger. Configure it to connect to your Whisper deployment. This flow will be responsible for sending audio files to the Whisper service and retrieving the transcription.

1. Create a manually triggered flow.

cha_cha_0-1715489824538.png

2. Add File input to the trigger.

cha_cha_1-1715489839041.png

cha_cha_2-1715489870097.png

3. Add a Compose action and replace the follow place holder with the input file’s filename and contentBytes.

cha_cha_3-1715489914538.png

{
  "$content-type": "multipart/form-data",
  "$multipart": [
    {
      "headers": {
        "Content-Disposition": "form-data; name="file"; filename="@{triggerBody()?['file']?['name']}""
      },
      "body": {
        "$Content-type": "audio/webm",
        "$content": @{triggerBody()?['file']?['contentBytes']}
      }
    }
  ]
}

4. Add an HTTP action with the following parameters.

 

URI:

FORMAT:
{Step 1 EndPoint}/openai/deployments/{Step2 Deployment}/audio/transcriptions?api-version=2024-02-01
EXAMPLE:
https://whisper-prototype-ai.openai.azure.com/openai/deployments/speech-to-text/audio/transcriptions?api-version=2024-02-01

Method:

POST

Headers:

content-type: multipart-form/data

api-key: [use the key from Step 1]

Body:

Output of Compose Action

cha_cha_0-1715490163054.png

5.  Optional: Add another Compose action to display result.

outputs('HTTP')['body']['text']

cha_cha_0-1715491136347.png

This post was originally published on this site

- Advertisement -spot_img

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisement - Advertisement

Latest News

Preferred Solution | New feature | Microsoft Dataverse

Click on the below image to navigate to my YouTube Channel. Please like and share your valuable feedback on this...

More Articles Like This

- Advertisement -spot_img