Quickstart: Create a Cognitive Services resource using the Azure portal
Use this quickstart to create a Cognitive Services resource. After you create a Cognitive Service resource in the Azure portal , you'll get an endpoint and a key for authenticating your applications.
Azure Cognitive Services are cloud-based services with REST APIs, and client library SDKs available to help developers build cognitive intelligence into applications without having direct artificial intelligence (AI) or data science skills or knowledge. Azure Cognitive Services enables developers to easily add cognitive features into their applications with cognitive solutions that can see, hear, speak, understand, and even begin to reason.
Types of Cognitive Services resource
You can access Azure Cognitive Services through two different resources: A multi-service resource, or a single-service one.
- Multi-service resource:
- Access multiple Azure Cognitive Services with a single key and endpoint.
- Consolidates billing from the services you use.
- Single-service resource:
- Access a single Azure Cognitive Service with a unique key and endpoint for each service created.
- Use the free tier to try out the service.
Prerequisites
- A valid Azure subscription - Create one for free.
- Your Azure account must have a Cognitive Services Contributor role assigned in order for you to agree to the responsible AI terms and create a resource. To get this role assigned to your account, follow the steps in the Assign roles documentation, or contact your administrator.
Create a new Azure Cognitive Services resource
The multi-service resource is named Cognitive Services in the portal. The multi-service resource enables access to the following Cognitive Services:
- Decision - Content Moderator
- Language - Language, Translator
- Speech - Speech
- Vision - Computer Vision, Custom Vision, Face
You can select this link to create an Azure Cognitive multi-service resource: Create a Cognitive Services resource.
On the Create page, provide the following information:
Project details Description Subscription Select one of your available Azure subscriptions. Resource group The Azure resource group that will contain your Cognitive Services resource. You can create a new group or add it to a pre-existing group. Region The location of your cognitive service instance. Different locations may introduce latency, but have no impact on the runtime availability of your resource. Name A descriptive name for your cognitive services resource. For example, MyCognitiveServicesResource. Pricing tier The cost of your Cognitive Services account depends on the options you choose and your usage. For more information, see the API pricing details. Configure additional settings for your resource as needed, read and accept the conditions (as applicable), and then select Review + create.
Tip
If your subscription doesn't allow you to create a Cognitive Service resource, you may need to enable that ability of the Azure resource provider with the Azure portal, PowerShell command or an Azure CLI command. If you are not the subscription owner, ask the Subscription Owner or someone with a role of admin to complete the registration for you or ask for the /register/action privileges granted to your account.
Get the keys for your resource
After your resource is successfully deployed, select Next Steps > Go to resource.
From the quickstart pane that opens, you can access the resource endpoint and manage keys.
Configure an environment variable for authentication
Applications need to authenticate access to the Cognitive Services they use. To authenticate, we recommend creating an environment variable to store the keys for your Azure Resources.
After you have your key, write it to a new environment variable on the local machine running the application. To set the environment variable, open a console window, and follow the instructions for your operating system. Replace your-key
with one of the keys for your resource.
setx COGNITIVE_SERVICE_KEY "your-key"
After you add the environment variable, you may need to restart any running programs that will need to read the environment variable, including the console window. For example, if you are using Visual Studio as your editor, restart Visual Studio before running the example.
Clean up resources
If you want to clean up and remove a Cognitive Services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources contained in the group.
- In the Azure portal, expand the menu on the left side to open the menu of services, and choose Resource Groups to display the list of your resource groups.
- Locate the resource group containing the resource to be deleted.
- If you want to delete the entire resource group, select the resource group name. On the next page, Select Delete resource group, and confirm.
- If you want to delete only the Cognitive Service resource, select the resource group to see all the resources within it. On the next page, select the resource that you want to delete, click the ellipsis menu for that row, and select Delete.
If you need to recover a deleted resource, see Recover deleted Cognitive Services resources.
See also
- See Authenticate requests to Azure Cognitive Services on how to securely work with Cognitive Services.
- See What are Azure Cognitive Services? to get a list of different categories within Cognitive Services.
- See Natural language support to see the list of natural languages that Cognitive Services supports.
- See Use Cognitive Services as containers to understand how to use Cognitive Services on-prem.
- See Plan and manage costs for Cognitive Services to estimate cost of using Cognitive Services.
Feedback
Submit and view feedback for