Error in Azure OpenAI API integration

Wallison Ferreira 0 Reputation points
2025-01-14T16:44:28.64+00:00

Hi,

I'm trying login ain azure CLI in order to get access-token resource Azure Open AI by running these commands on PowerShell using azure CLI.

az login --scope api://https://ai-exampledomain.openai.azure.com//.default

az account get-access-token --resource api://https://ai-exampledomain.openai.azure.com/ --query accessToken -o tsv

But, login doesn't work and show the following error:

"Select the account you want to log in with. For more information on login with Azure CLI, see https://go.microsoft.com/fwlink/?linkid=2271136

(pii). Status: Response_Status.Status_IncorrectConfiguration, Error code: 3399614475, Tag: 508634112"

I also tried to login by specifying the Tentant, and the subscription, but it return thee same error.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,335 questions
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 10,340 Reputation points
    2025-01-14T18:00:33.15+00:00

    Hello Wallison Ferreira,

    Thanks for posting your question in the Microsoft Q&A forum.

    Ensure you have the latest version of Azure CLI installed. You can update it using:

    az upgrade
    

    Clear your Azure CLI token cache

    az account clear
    

    Try logging in with the interactive browser method

    az login
    
    

    If the interactive login doesn't work, try using device code authentication

    az login --use-device-code
    

    If you're still facing issues, check if your Azure AD application has the correct permissions and is properly configured for the Azure OpenAI service For the az account get-access-token command, ensure you're using the correct resource URL.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.