Azure / azure-cli

Azure Command-Line Interface
MIT License
3.99k stars 2.98k forks source link

Non-terminating errors returned for Azure service creation #30086

Open shribr opened 5 hours ago

shribr commented 5 hours ago

Describe the bug

The following services do not return a terminating error when attempting to execute any of the below CLI commands. This makes error handling rather cumbersome, and it also makes the behavior inconsistent with all of the other az create commands.

API Management Service

az apim api create --api-id apiManagementService.ApiId --service-name $apiManagementServiceName --display-name $apiManagementService.Display --resource-group $resourceGroupName --path $apiManagementService.Path

Document Intelligence

az cognitiveservices account create --name $documentIntelligenceName --resource-group $resourceGroupName --location $($location.ToUpper() -replace '\s', '') --kind FormRecognizer --sku S0 --output none

AI Model

az cognitiveservices account deployment create --name $cognitiveServiceName --resource-group $resourceGroupName --deployment-name chat --model-name gpt-4o --model-version "2024-05-13" --model-format OpenAI --sku-capacity 1 --sku-name "B1" 2>&1

Note: In addition to the poor error handling, the documentation is quite sparse when trying to create a new AI model using CLI. The only message I get is "The account deployments are not supported by the current SKU". There is no additional information. It would be extremely helpful if I were told which SKUs WERE supported for the account deployment, so I don't have to guess. Also, what exactly am I supposed to change? Is there a list of supported SKUs or is the issue that my Azure AI service deployment will NEVER be compatible with the SKUs required to deploy the AI model? If it's the latter, then the error details should state this explicitly.

Here are some of the links I've found that dance around the issue but still don't provide a complete picture:

Resolve errors for SKU not available

Problem creating a deployment with GPT4 model. Current subscription does not have feature required by this model

The specified scale type 'Standard' of account deployment is not supported by the model 'gpt-4'.

The workaround is to check the output for the error message, but this is clearly not ideal.

Related command

az cognitiveservices account deployment create

az apim api create

az cognitiveservices account create

Errors

The account deployments are not supported by the current SKU

Issue script & Debug output

The account deployments are not supported by the current SKU

Expected behavior

For the commands to return an actual error message. Since they do not return a terminating error, I can't even debug with Write-Error.

Environment Summary

azure-cli 2.62.0 *

core 2.62.0 * telemetry 1.1.0

Extensions: application-insights 1.2.2 init 0.1.0 ml 2.30.1 portal 0.1.3

Dependencies: msal 1.28.1 azure-mgmt-resource 23.1.1

Additional context

No response

azure-client-tools-bot-prd[bot] commented 5 hours ago

Hi @shribr,

2.62.0 is not the latest Azure CLI(2.65.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

yonzhan commented 5 hours ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 5 hours ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @solankisamir, @mikebudzynski, @KedarJoshi, @yingru97.