LinuxCommandLibrary

az-cognitiveservices

Manage Azure Cognitive Services resources

TLDR

Create an API Cognitive Services account in a specific location without confirmation required

$ az cognitiveservices account create [[-n|--name]] [account_name] [[-g|--resource-group]] [resource_group] --kind [API_name] [[-l|--location]] [location] --sku [sku_name] --yes
copy

List usages for Azure Cognitive Services account
$ az cognitiveservices account list-usage [[-n|--name]] [account_name] [[-g|--resource-group]] [resource_group]
copy

Create a deployment for Azure Cognitive Services account
$ az cognitiveservices account deployment create [[-n|--name]] [account_name] [[-g|--resource-group]] [resource_group] --deployment-name [deploy_name] --model-name [model_name] --model-version "[model_version]" --model-format [format_name]
copy

Create a commitment plan for Azure Cognitive Services account
$ az cognitiveservices account commitment-plan create [[-n|--name]] [account_name] [[-g|--resource-group]] [resource_group] --commitment-plan-name "[plan_name]" --hosting-model "[hosting_model]" --plan-type "[plan_type]" --auto-renew [false|true]
copy

Delete a commitment plan from Azure Cognitive Services account
$ az cognitiveservices account commitment-plan delete [[-g|--resource-group]] [resource_group] [[-n|--name]] [account_name] --commitment-plan-name "[plan_name]"
copy

SYNOPSIS

az cognitiveservices [options]

Common subcommands include:
az cognitiveservices account [options] (e.g., create, list, show, delete, keys)
az cognitiveservices deployment [options] (e.g., create, list, show, delete)
az cognitiveservices commitment-tier [options] (e.g., list, show)

PARAMETERS

--help -h
    Show help message for the command or subcommand.

--output -o
    Output format. Values: json, jsonc, table, tsv, yaml, yamlc, none. Default: json.

--query
    JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose
    Increase logging verbosity to show debug logs.

--debug
    Increase logging verbosity to show all debug logs.

--subscription
    Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--only-show-errors
    Put errors on stderr, and do not show warnings or other information.

--yes -y
    Do not prompt for confirmation.

DESCRIPTION

The az-cognitiveservices command refers to the command group within the Azure Command-Line Interface (CLI) used for managing Azure Cognitive Services. These services provide powerful AI capabilities, such as vision, speech, language, and decision-making, which developers can integrate into their applications.

The az cognitiveservices command group allows users to programmatically interact with their Cognitive Services resources in Azure. This includes operations like creating, listing, showing details of, updating, and deleting Cognitive Services accounts, managing API keys, and handling resource deployments. It serves as a vital tool for automating resource provisioning, configuration, and management tasks, making it easier to integrate AI capabilities into continuous integration/continuous deployment (CI/CD) pipelines and scripting environments.

CAVEATS

  • Requires the Azure CLI to be installed and configured on the Linux system.
  • Users must be authenticated to Azure using az login with appropriate permissions for resource management.
  • Understanding of Azure resource groups, subscriptions, and Cognitive Services resource types is essential for effective use.
  • API limits and costs are associated with Cognitive Services resources; careful management is advised.

COMMON USAGE PATTERN

To create a Cognitive Services account:
az cognitiveservices account create --name myCognitiveAccount --resource-group myResourceGroup --kind TextAnalytics --sku S0 --location eastus

API KEYS MANAGEMENT

After creating an account, you can retrieve its API keys using:
az cognitiveservices account keys list --name myCognitiveAccount --resource-group myResourceGroup

MODEL DEPLOYMENT (E.G., AZURE OPENAI)

For services like Azure OpenAI, deploying a model is crucial:
az cognitiveservices deployment create --name myDeployment --account-name myOpenAIAccount --resource-group myResourceGroup --model-name gpt-4 --model-version 0613 --model-format OpenAI --sku-name Standard --capacity 1

HISTORY

The Azure CLI has evolved significantly since its initial release, with continuous integration of new Azure services. The Cognitive Services command group was introduced as part of this ongoing development, providing native command-line support for managing these AI services. Its usage has grown steadily alongside the increased adoption of Azure Cognitive Services, becoming a standard tool for developers and operations teams seeking to automate and script their AI infrastructure management within Azure.

SEE ALSO

az(1), curl(1), jq(1)

Copied to clipboard