I'm trying to use Whisper using the AzureCliCredential and i always get an error as follow
{ code: 'Request is badly formated', message: 'Resource Id is badly formed: NA' }
my very simple code is :
import * as fs from "fs";
import { AzureCliCredential } from "@azure/identity";
import { OpenAIClient } from "@azure/openai";
const AZURE_SPEECH_ENDPOINT = "https://westeurope.api.cognitive.microsoft.com/";
const client = new OpenAIClient(AZURE_SPEECH_ENDPOINT, new AzureCliCredential());
const res = await client.getAudioTranscription("whisper", await fs.promises.readFile(`audio.m4a`));
it works perfectly I use the access key instead :
const client = new OpenAIClient(AZURE_SPEECH_ENDPOINT, new AzureKeyCredential("xxxxxx"));
I checked my role assignments on the resource and my account is assigned :
Cognitive Services Contributor
Cognitive Services OpenAI Contributor
Cognitive Services OpenAI User
Cognitive Services Speech Contributor
Cognitive Services Speech User
Cognitive Services User
I also checked that I am correctly logged on right tenant and subscription using az login.
What is the issue ?