Azure Cognitive Services are used to build an intelligent application without having an AI or data science skill. Azure PowerShell contains a set of modules to manage Azure resources.
Azure Cognitive Services
Before you begin to utilize PowerShell to oversee the Azure PowerShell, ensure that the Azure PowerShell has been installed. If not installed, here is an article How to install the Azure PowerShell module. You need to do this only once for each computer from which you are running Azure PowerShell commands.
Connect to Azure Portal
Creating Azure Resource Group
You can create Resource Groups in Azure using New-AzureRmResourceGroup cmdlets. The required parameters are,
- Name - Specify the name of the resource group.
- Location - Specify the Azure data center location of the resource group, such as South India and West US.
- $ResourceGroupName = "HubflyIoTRG1730"
- $location = "WestUS"
- New - AzureRmResourceGroup - Name $ResourceGroupName - Location $location
Now, check your Azure portal -- the resource group will be created.
Creating an Azure Cognitive Service Account
- ResourceGroupName - Specify the name of the resource group.
- Name - Specify the name of the account.
- Type - Specify the type of account to create.
- SkuName - Specify the Sku for the account. The acceptable values are,
- F0 (free tier),
- S0
- S1
- S2
- S3
- S4
- Location - Specify the Azure data center location of the resource group, such as South India and West US.
- New-AzureRmCognitiveServicesAccount -ResourceGroupName $ResourceGroupName -name HubflyCognitiveService -Type CognitiveServices -SkuName S0 -Location 'WestUS'

Final Code
- Connect - AzureRmAccount
- $name = Read - Host 'Please Enter the name of the Coginitive Service'
- $ResourceGroupName = Read - Host 'Please Enter the Resource group name'
- $location = Read - Host 'Please Enter the Location'
- $skuName = "S0"
- New - AzureRmResourceGroup - Name $ResourceGroupName - Location $location
- New - AzureRmCognitiveServicesAccount - ResourceGroupName $ResourceGroupName - name $name - Type CognitiveServices - SkuName $skuName - Location $location
That's it. I hope you have learned how to create a Cognitive Service account using Azure PowerShell programmatically. Feel free to fill up the comment box below if you need any assistance.

Join the conversation! Your thoughts help the community grow.