通过 Azure 政府中的 CLI 提供的认知服务



文档提到它可以通过CLI访问,但文档中没有CLI示例,只有PowerShell。

关于从哪里开始的任何建议?

可以在认知服务 Azure CLI 文档中找到有关如何管理认知服务的详细信息。

与 Azure Government 一样:

  • 通过az cloud set --name=AzureUSGovernment将 CLI 设置为 Azure 政府
  • 使用 Azure 政府区域。
  • 使用 Azure 政府中可用的 API 子集(有关要与 --kind 一起使用的文本值,请参阅此文档(。
  • 使用 Azure 政府中可用的 SKU 子集

以下是有关如何开始的快速示例:

az cloud set --name AzureUSGovernment
az login
az group create -n cogstestrg -l usgovvirginia
az cognitiveservices account create -n cogstestcv -g cogstestrg --sku S0 --kind ComputerVision -l usgovvirginia
az cognitiveservices account show -g cogstestrg -n cogstestcv
az cognitiveservices account keys list -g cogstestrg -n cogstestcv
#Make sure you REPLACE_WITH_YOUR_KEY in the curl command below using the key from the previous command
curl -v -X POST "https://virginia.api.cognitive.microsoft.us/vision/v1.0/analyze?visualFeatures=Categories,Description,Color&details=&language=en" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: REPLACE_WITH_YOUR_KEY" --data-ascii "{'url' : 'http://upload.wikimedia.org/wikipedia/commons/3/3c/Shaki_waterfall.jpg'}"

最新更新