Connecting to Azure OpenAI Whisper Service in Power Automate
Table of Contents
- Prerequisites
- High Level Steps
- Step 1: Create Azure OpenAI Service:
- Create Azure OpenAI Service
- Copy a Key and the Endpoint URI
- Step 2: Create a Whisper Deployment
- Step 3: Create an HTTP Flow in Power Automate
Prerequisites
- An Azure Subscription with Azure OpenAI Service enabled. Azure OpenAI Service is currently limited. Apply for access here to your subscription by going to this link (https://aka.ms/oaiapply).
- Power Automate Premium
High Level Steps
- 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
Step 1: Create Azure OpenAI Service:
- 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.
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.
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
Step 2: Create a Whisper Deployment
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.
3. Put the following settings for the deployment then click Create.
Step 3: Create an HTTP Flow in Power Automate
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.
2. Add File input to the trigger.
3. Add a Compose action and replace the follow place holder with the input file's filename and contentBytes.
{
"$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
5. Optional: Add another Compose action to display result.
outputs('HTTP')['body']['text']
*This post is locked for comments