Ask Learn Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This module requires a sandbox to complete. A sandbox gives you access to free resources. Your personal subscription will not be charged. The sandbox may only be used to complete training on Microsoft Learn. Use for any other reason is prohibited, and may result in permanent loss of access to the sandbox.
Microsoft provides this lab experience and related content for educational purposes. All presented information is owned by Microsoft and intended solely for learning about the covered products and services in this Microsoft Learn module.
In the previous unit, you learned how to use the Azure portal to create an Azure AI services account.
In this exercise, you'll create an Azure AI services account using the Azure CLI.
The applications that you'll create in the upcoming exercises use this account to perform the speech to text operations.
In the Cloud Shell window on the right side of the screen, select the More icon (...), then select Settings > Go to Classic version.
Use the following code to create a variable to hold the name of the resource group that was created for you when you activated the Learn sandbox:
RESOURCEGROUP=[sandbox resource group name]
Create another variable to hold the region where your resource group is located:
LOCATION=$(az group show --name $RESOURCEGROUP | jq -r '.location')
You'll need the location when you create your application, so use the following command to list the contents of the $LOCATION
variable, then copy that value for later:
echo $LOCATION
Create another variable to contain your account name:
ACCOUNT=learn-account-$RANDOM
Create your Azure AI services account:
az cognitiveservices account create \
--name $ACCOUNT \
--resource-group $RESOURCEGROUP \
--kind SpeechServices \
--sku F0 \
--location $LOCATION \
--yes
In the preceding code:
Value | Description |
---|---|
name | Specifies the unique name for your Azure AI services account. |
Specifies the name of your resource group. | |
kind | Specifies the account type, which is SpeechServices for this exercise because we'll be creating a speech to text application. See az cognitiveservices account list-kinds for a list of account types. |
sku | Specifies the SKU for the account, which is the free F0 tier for this exercise. See az cognitiveservices account list-skus for a list of account SKUs. |
location | Specifies the location for the account. |
yes | Suppresses the prompt for terms confirmation. |
This command should take a few seconds to complete. You'll get a JSON response from Azure like the following example when the command finishes:
{
"etag": "\"00000000-0000-0000-0000-000000000000\"",
"id": "/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/learn-bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f/providers/Microsoft.CognitiveServices/accounts/learn-account-33333",
"identity": null,
"kind": "SpeechServices",
"location": "westus",
"name": "learn-account-33333",
"properties": {
...
},
"resourceGroup": "learn-bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f",
"sku": {
"capacity": null,
"family": null,
"name": "F0",
"size": null,
"tier": null
},
"tags": null,
"type": "Microsoft.CognitiveServices/accounts"
}
When your Azure AI services account has been created, use the following command to list the keys:
az cognitiveservices account keys list \
--name $ACCOUNT \
--resource-group $RESOURCEGROUP
You should see a JSON response like the following example:
{
"key1": "0123456789abcdef0123456789abcdef",
"key2": "fedcba9876543210fedcba9876543210"
}
Copy the value for either key; you'll use that key when you create your application in a later exercise.
Having an issue? We can help!
Please sign in to use this experience.
Sign in