List Azure AI Services Security Keys with Azure CLI

In this Microsoft Azure AI services and Azure CLI post, we will show how to list the security keys of an Azure AI resource using Azure CLI.

Keys and Endpoint

When we create an Azure AI services resource, by default, the resource is provisioned with a security key and an endpoint URL that allows us to access the service using RAST API and other programming tools.

The keys and endpoint are located under Resource Management on the resource page.

To list the keys of an Azure AI resource, make sure you have Azure CLI installed.

List Keys

The following cmdlet will list the two security keys with an Azure AI Services resource. Add your resource group and Azure AI service resource names and run the command.

az cognitiveservices account keys list --name <resourceName> --resource-group <resourceGroup>

Regenerate a New Security Key

To regenerate a new security key, run the following command.

 az cognitiveservices account keys regenerate --name <resourceName> --resource-group <resourceGroup> --key-name key2

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.