New-AzCognitiveServicesAccount

91 views Asked by At

I've created a subdomain in Azure Cloud Shell using:

Set-AzContext -SubscriptionName "Azure subscription 1"

When I run the following command:

$account = New-AzCognitiveServicesAccount -ResourceGroupName cloud-shell-storage-southcentralus -name cs710032000dd678293 -Type StorageV2 -SkuName S0 -Location southcentralus -CustomSubdomainName 'Progression' 

I receive this error:

New-AzCognitiveServicesAccount: Operation returned an invalid status code 'BadRequest' The account type 'StorageV2' is either invalid or unavailable in given region.

I'm following the Microsoft training module to prepare for a certification exam in a couple weeks, any help would be appreciated.

I've tried changing the account type multiple times and modify the command to resemble examples found on here and the Microsoft learn pages. As previously mentioned, I'm studying for a certification, (Microsoft Certified: Azure AI Engineer Associate) and this error has turned into a brick wall, please help.

1

There are 1 answers

0
Gaurav Mantri On

The reason you are getting this error is because -Type parameter indicates the type of Cognitive Service you are trying to create and StorageV2 is not a valid type (it is valid for a storage account type of resource). From the documentation here:

enter image description here

You need to provide the correct type. You can find the valid values for the type of Cognitive Service by using Get-AzCognitiveServicesAccountType Cmdlet.