|
| 1 | +--- |
| 2 | +title: Create a Translator resource |
| 3 | +titleSuffix: Azure AI services |
| 4 | +description: Learn how to create an Azure AI Translator resource and obtain your API key and endpoint URL through the Azure portal. |
| 5 | +author: laujan |
| 6 | +ms.author: lajanuar |
| 7 | +manager: nitinme |
| 8 | +ms.date: 01/27/2025 |
| 9 | +ms.service: azure-ai-translator |
| 10 | +ms.topic: how-to |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +# Create a Translator resource |
| 15 | + |
| 16 | +In this article, you learn how to create a Translator resource in the Azure portal. [Azure AI Translator](translator-overview.md) is a cloud-based machine translation service that is part of the [Azure AI services](../what-are-ai-services.md) family. Azure resources are instances of services that you create. All API requests to Azure AI services require an *endpoint* URL and a read-only *key* for authenticating access. |
| 17 | + |
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +To get started, you need an active [**Azure account**](https://azure.microsoft.com/free/cognitive-services/). If you don't have one, you can [**create a free 12-month subscription**](https://azure.microsoft.com/free/). |
| 21 | + |
| 22 | +## Create your resource |
| 23 | + |
| 24 | +With your Azure account, you can access the Translator service through two different resource types: |
| 25 | + |
| 26 | +* [**Single-service**](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) resource types enable access to a single service API key and endpoint. |
| 27 | + |
| 28 | +* [**Multi-service**](https://portal.azure.com/#create/Microsoft.CognitiveServicesAllInOne) resource types enable access to multiple Azure AI services by using a single API key and endpoint. |
| 29 | + |
| 30 | +## Complete your project and instance details |
| 31 | + |
| 32 | +After you decide which resource type you want use to access the Translator service, you can enter the details for your project and instance. |
| 33 | + |
| 34 | +1. **Subscription**. Select one of your available Azure subscriptions. |
| 35 | + |
| 36 | +1. **Resource Group**. You can create a new resource group or add your resource to a preexisting resource group that shares the same lifecycle, permissions, and policies. |
| 37 | + |
| 38 | +1. **Resource Region**. Choose **Global** unless your business or application requires a specific region. If you're planning on using the Document Translation feature with [managed identity authorization](document-translation/how-to-guides/create-use-managed-identities.md), choose a geographic region such as **East US**. |
| 39 | + |
| 40 | +1. **Name**. Enter a name for your resource. The name you choose must be unique within Azure. |
| 41 | + |
| 42 | + > [!NOTE] |
| 43 | + > If you're using a Translator feature that needs a custom domain endpoint, such as Document Translation, the input in the `name` field it the custom domain name parameter for the endpoint. |
| 44 | + > Make sure to enter the correct value in the `name` field to ensure proper functionality. |
| 45 | +
|
| 46 | +1. **Pricing tier**. Select a [pricing tier](https://azure.microsoft.com/pricing/details/cognitive-services/translator) that meets your needs: |
| 47 | + |
| 48 | + * Each subscription has a free tier. |
| 49 | + * The free tier has the same features and functionality as the paid plans and doesn't expire. |
| 50 | + * Only one free tier resource is available per subscription. |
| 51 | + * Document Translation is supported in paid tiers. The Language Studio only supports the S1 or D3 instance tiers. If you just want to try Document Translation, select the Standard S1 instance tier. |
| 52 | + |
| 53 | +1. If you created a multi-service resource, the links at the bottom of the **Basics** tab provides technical documentation regarding the appropriate operation of the service. |
| 54 | + |
| 55 | +1. Select **Review + Create**. |
| 56 | + |
| 57 | +1. Review the service terms, and select **Create** to deploy your resource. |
| 58 | + |
| 59 | +1. After your resource successfully deploys, select **Go to resource**. |
| 60 | + |
| 61 | +### Authentication keys and endpoint URL |
| 62 | + |
| 63 | +All Azure AI services API requests require an endpoint URL and a read-only key for authentication. |
| 64 | + |
| 65 | +* **Authentication keys**. Your key is a unique string that is passed on every request to the Translation service. You can pass your key through a query-string parameter or by specifying it in the HTTP request header. |
| 66 | + |
| 67 | +* **Endpoint URL**. Use the Global endpoint in your API request unless you need a specific Azure region or custom endpoint. For more information, see [Base URLs](reference/v3-0-reference.md#base-urls). The Global endpoint URL is `api.cognitive.microsofttranslator.com`. |
| 68 | + |
| 69 | +## Get your authentication keys and endpoint |
| 70 | + |
| 71 | +To authenticate your connection to your Translator resource, you need the key and endpoint for your resource. |
| 72 | + |
| 73 | +1. After your new resource deploys, select **Go to resource** or go to your resource page. |
| 74 | +1. In the left navigation pane, under **Resource Management**, select **Keys and Endpoint**. |
| 75 | +1. Copy and paste your keys and endpoint URL in a convenient location, such as Notepad. |
| 76 | + |
| 77 | +:::image type="content" source="media/keys-and-endpoint-resource.png" alt-text="Screenshot of the Azure portal showing the Keys and Endpoint page of a Translator resource. The keys and endpoints are highlighted."::: |
| 78 | + |
| 79 | +## Create a Text Translation client |
| 80 | + |
| 81 | +Text Translation supports both [global and regional endpoints](#complete-your-project-and-instance-details). Once you have your [authentication keys](#authentication-keys-and-endpoint-url), you need to create an instance of the `TextTranslationClient`, using an `AzureKeyCredential` for authentication, to interact with the Text Translation service: |
| 82 | + |
| 83 | +* To create a `TextTranslationClient` using a global resource endpoint, you need your resource **API key**: |
| 84 | + |
| 85 | + ```bash |
| 86 | + AzureKeyCredential credential = new('<apiKey>'); |
| 87 | + TextTranslationClient client = new(credential); |
| 88 | + ``` |
| 89 | + |
| 90 | +* To create a `TextTranslationClient` using a regional resource endpoint, you need your resource **API key** and the name of the **region** where your resource is located: |
| 91 | + |
| 92 | + ```bash |
| 93 | + AzureKeyCredential credential = new('<apiKey>'); |
| 94 | + TextTranslationClient client = new(credential, '<region>'); |
| 95 | + ``` |
| 96 | + |
| 97 | +## How to delete a resource or resource group |
| 98 | + |
| 99 | +> [!WARNING] |
| 100 | +> |
| 101 | +> Deleting a resource group also deletes all resources contained in the group. |
| 102 | + |
| 103 | +To delete the resource: |
| 104 | + |
| 105 | +1. Search and select **Resource groups** in the Azure portal, and select your resource group. |
| 106 | +1. Select the resources to be deleted by selecting the adjacent check box. |
| 107 | +1. Select **Delete** from the top menu near the right edge. |
| 108 | +1. Enter *delete* in the **Delete Resources** dialog box. |
| 109 | +1. Select **Delete**. |
| 110 | + |
| 111 | +To delete the resource group: |
| 112 | + |
| 113 | +1. Go to your Resource Group in the Azure portal. |
| 114 | +1. Select **Delete resource group** from the top menu bar. |
| 115 | +1. Confirm the deletion request by entering the resource group name and selecting **Delete**. |
| 116 | + |
| 117 | +## How to get started with Azure AI Translator REST APIs |
| 118 | + |
| 119 | +In our quickstart, you learn how to use the Translator service with REST APIs. |
| 120 | + |
| 121 | +> [!div class="nextstepaction"] |
| 122 | +> [Get Started with Translator](quickstart-text-rest-api.md) |
| 123 | + |
| 124 | +## Next Steps |
| 125 | + |
| 126 | +Learn more about Azure AI Translator features: |
| 127 | + |
| 128 | +* [Text Translation](text-translation-overview.md) |
| 129 | +* [Document Translation](document-translation/overview.md) |
| 130 | +* [Custom Translation](custom-translator/overview.md) |
0 commit comments