
In this Azure tutorial, we will discuss How To Create Azure Cognitive Service Account PowerShell. Along with this, we will also discuss a few other topics like Create Azure Cognitive Service Account Using PowerShell script and How To Create Azure Cognitive Service Account Azure Portal, Subscription Key For Microsoft Cognitive Services, Azure Text To Speech.
How To Create Azure Cognitive Services PowerShell? You can create Azure Cognitive Services in PowerShell using the following steps
- Connect to Azure Portal using Connect-AzureRmAccount PowerShell cmdlet.
- Create a Resource Group using PoweNew-AzureRmResourceGroup PowerShell cmdlet.
- Create an Azure Cognitive Service using New-AzureRmCognitiveServicesAccount cmdlet
We will see in detail steps below.
Table of Contents
- How To Create Azure Cognitive Service Account PowerShell
- What is Azure Cognitive Services
- Prerequisites
- Connect to Azure Portal
- Create Azure Resource Group PowerShell
- Create the Azure Cognitive Services Account PowerShell
- How To Create Azure Cognitive Service Account Azure Portal
- Subscription Key For Microsoft Cognitive Services
- Azure Text To Speech
- Key Features Of Azure Text To Speech Service
- Pricing Azure Text To Speech Service
- Implementation of the Azure Text To Speech Service
- Wrapping Up
How To Create Azure Cognitive Service Account PowerShell
Well, here we will discuss How To Create Azure Cognitive Services Account PowerShell. We can also able to create the Azure Cognitive Services Account using Azure Portal that we will see later. Now we will discuss How To Create Azure Cognitive Services PowerShell. Before starting the actual development, we should know What is Azure Cognitive Services and what are the Prerequisites needed to create Azure Cognitive Service Account PowerShell.
What is Azure Cognitive Services
Microsoft Azure Cognitive services is an excellent service from Microsoft that provides a number of Azure service APIs that actually helps you with the ability to make it easy to enhance your applications in different areas like vision, speech, knowledge, search and language, etc. These APIs provide you the ability to implement the AI features in these areas. Check out some more information on Azure Cognitive services now.
Prerequisites
- Make sure to Install the PowerShell latest version with the Azure PowerShell module.
- You must have a valid Azure Subscription or a Valid Azure Account. If you don’t have till now, create an Azure Free Account now.
Assuming that you have all the Prerequisites are ready, let’s start developing the actual functionality. Follow the below steps to Create Azure Cognitive Services using PowerShell.
Open the Windows PowerShell or PowerShell ISE as Run as Administrator mode.

Connect to Azure Portal
As we need to create the Azure Cognitive Services in the Azure Portal. So we need to connect to the Azure Portal, After that only we can able to create any of the Azure Resource in the Azure Portal.
You need to use the below PowerShell cmdlet to connect to the Azure Portal.
PS C:\WINDOWS\system32> Connect-AzureRmAccount
Once you will run the above PowerShell cmdlet, It will prompt you to enter your Azure Credentials. Enter your Azure credentials and then click on the Sign-in button.

Create Azure Resource Group PowerShell
Now the next step is we need to create a Resource Group that we need to create the Azure Cognitive Services. You can able to group Azure resources together that belong to one application in Azure. This is one of the benefits of Azure Resource Group.
Use the below PowerShell cmdlet to create a Resource Group in Azure
C:\WINDOWS\system32> New-AzureRmResourceGroup
Below are parameters value we need to provide along with this PowerShell cmdlet to create the Resource Group in Azure
- Name: You need to provide the unique name of the Resource Group.
- Location: Specify the location for your Azure Resource Group
Below is the script with the parameter value
Connect-AzureRmAccount
$myrsggrpname = "Demo123"
$mylocation = "EastUS"
New-AzureRmResourceGroup -Name $myrsggrpname -Location $mylocation
Now once you will run the above script, you can able to see below that the Resource Group got created Successfully

Now just to cross check that the Resource Group is Created, Let’s verify in the Azure Portal.
Log in to the Azure Portal, search for the Resource Group and then click on the search result Resource Group to navigate to the Resource Group Page, Then you can able to see the Resource Group is present in the list of Resource Groups as shown below

Now that our Resource Group is created successfully, the next step is we need to create the Azure Cognitive Services.
Create the Azure Cognitive Services Account PowerShell
We can create the Azure Cognitive Services Account using the New-AzureRmCognitiveServicesAccount cmdlet.
Below are the set of parameters those we need to pass value with the New-AzureRmCognitiveServicesAccount cmdlet
- ResourceGroupName: Specify the Resource Group name that you want to use in this case
- Name: Provide a unique name for the Azure Cognitive Services Account.
- Type: The next parameter is, you need to specify the type of the Azure Cognitive Services Account.
- SKUName: This is related to the pricing tier. The value can be F0(Free tier), S1, S2. S3, etc. You can use the F0 tier if it is just for demo purposes. Choose this value based on your requirement.
- Location: You need to provide the location for the Azure data center of the Resource group.
You can use the below script to create the Azure Cognitive Services Account.
Connect-AzureRmAccount
$myrsggrpname = "Demo123"
$mylocation = "EastUS"
New-AzureRmCognitiveServicesAccount -ResourceGroupName $myrsggrpname -name MyDemotestCognitiveService -Type CognitiveServices -SkuName S0 -Location $mylocation
You can able to see, after executing the above PowerShell script, the Azure Cognitive Services Account created successfully without any issue

Now, to make sure it is created successfully, we will check in the Azure Portal if it is created or not. To check that Login to the Azure Portal, Search for the Cognitive Services and click on the search result Cognitive Services to navigate to the Cognitive Services page.
You will see the list of Cognitive Services those you have created already, As shown below, you will find out the newly created Azure Cognitive Services Account.

How To Create Azure Cognitive Service Account Azure Portal
We have discussed above, How To Create Azure Cognitive Service Account PowerShell. Now the time to discuss, How To Create Azure Cognitive Services Azure Portal. Follow the below steps to Create Azure Cognitive Services Azure Portal
I have already written an article on the same. So Create Azure Cognitive Services Azure Portal now.
So, This is How To Create Azure Cognitive Services PowerShell and How To Create Azure Cognitive Services Azure Portal.
Subscription Key For Microsoft Cognitive Services
Well, here we will discuss, How to get the Subscription Key For Microsoft Cognitive Services. We have already created An Microsoft Azure Cognitive Services by following the above steps. Follow the below steps to get the Subscription Key For Microsoft Cognitive Services.
Login to the Azure Portal
Once you logged in to the Azure Portal, then you need to search for the Cognitive Services. Then click on the search result as shown below

On the Cognitive services page, you can able to see the list of Cognitive services that you have created already. Click on the Azure Cognitive service for which one you want to get the Subscription key values.
On your Azure Cognitive service page, click on the Keys and Endpoint link from the left navigation. Then you can able to see the Key 1 and Key 2 value and you can click on the copy button as highlighted to copy the key values. You can click on the Show Keys button to see the value of those Key 1 and Key 2.
If you are not happy with the Key 1 and Key 2 values then you can also regenerate those values by clicking on the Regenerate key1 and Regenerate key2 button from the top as highlighted below.
Along with the Key values, you can also able to get the ENDPOINT and LOCATION of the Azure Cognitive service.
You can either use the Key 1 or Key 2 value to access the Azure Cognitive service from outside.

This is how you can able to get the Subscription Key For Microsoft Cognitive Services.
Azure Text To Speech
Azure Text to speech service is an excellent service from Microsoft that actually helps your applications, tools, or devices to convert text to speech like from human. As part of the Azure Text to speech service, there are more than 75 standard voices are available in more than 45 languages.
The languages are Arabic, Bulgarian, Catalan, Czech, Danish, German, Greek, English, Spanish, Finnish, French, Hebrew, Hindi, Croatian, Hungarian, Indonesian, Italian, Japanese, Korean, Malay, Dutch, Polish, Portuguese, Romanian, Russian, Slovak, Tamil, Telugu, Thai, Turkish, Mandarin, Cantonese, Mandarin, etc.
Including this, another 5 neural voices are also available for a few languages. The list of languages is Arabic, Bulgarian, Catalan, Czech, Danish, German, Greek, English, Australian, English, Spanish, Finnish, French, Hindi, Croatian, Italian, Japanese, Korean, Malay, Dutch, Polish, Romanian, Russian, Slovak, Swedish, Tamil, Telugu, Thai, Turkish, Vietnamese, etc.
Key Features Of Azure Text To Speech Service
Azure Text To Speech Service provides many important features. Out of those, here we will discuss a few key features of Azure Text To Speech Service.
- Azure Text to Speech Service provides the Azure SDKs and the REST API to convert from Text to Speech.
- Easily you can make your Application to use the service with 45 languages support.
- The output can be customized with Speech Synthesis Markup Language (SSML).
In order to use the Text To Speech Service in your application, you must have an Azure account and Speech service subscription as a prerequisite. If you don’t have an Azure account, Create a Free Azure Account now.
Pricing Azure Text To Speech Service
One important point to note down in terms of Pricing for the Azure Text To Speech Service is you need to pay for each character including the punctuation, phonemes, and pitch that you want to convert to speech.
Below are the cases where you need to pay for the Azure Text To Speech Service
- The text you are passing to the Azure Text To Speech Service
- You need to pay for all the markups in the text field.
- Next is, you need to pay for the tabs, Letters, spaces, punctuations, etc.
Implementation of the Azure Text To Speech Service
As part of the implementation of the Azure Text To Speech Service to your application, the first and the most important step is, you need to initialize the SpeechConfig. The initialization can be done in many ways, those are as below
- The first way is you need to pass the key and the region associated with the Azure Text To Speech Service as the parameters along with the subscription.
- You can pass the service Endpoint. Optionally, you can pass an authorization token along with the service Endpoint.
- The third way to initialize the SpeechConfig is to pass a host address. In this case also the Optionally, you can pass an authorization token if you want.
- The fourth way is, you can also pass an authorization token with the associated region.
If you will consider the first way, then the syntax will be like below
static async Task Method1()
{
var myconfig = SpeechConfig.FromSubscription("Enter your SubscriptionKey here", "Enter Your Service Region here");
}
You may also like following the below articles
- New-AzResourceGroup: A positional parameter cannot be found that accepts argument
- How to Create And Consume Azure Function From ASP.NET Core
- How To Create PowerShell Azure Function
Wrapping Up
Well, in this article, we discussed How To Create Azure Cognitive Service Account PowerShell, Create Azure Cognitive Service Account PowerShell script, and How To Create Azure Cognitive Service Account Azure Portal, Subscription Key For Microsoft Cognitive Services, Azure Text To Speech. Hope you have enjoyed this article !!!