You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/Translator/document-translation/how-to-guides/use-client-sdks.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,11 @@ ms.author: lajanuar
15
15
# Document Translation client-library SDKs
16
16
<!-- markdownlint-disable MD024 -->
17
17
<!-- markdownlint-disable MD001 -->
18
-
[Document Translation](../overview.md) is a cloud-based feature of the [Azure Translator](../../translator-overview.md) service. You can translate entire documents or process batch document translations in various file formats while preserving original document structure and format. In this article, you'll learn how to use the Document Translation service C#/.NET and Python client libraries. For the REST API, see our [Quickstart](../quickstarts/get-started-with-rest-api.md) guide.
18
+
[Document Translation](../overview.md) is a cloud-based feature of the [Azure Translator](../../translator-overview.md) service. You can translate entire documents or process batch document translations in various file formats while preserving original document structure and format. In this article, you learn how to use the Document Translation service C#/.NET and Python client libraries. For the REST API, see our [Quickstart](../quickstarts/get-started-with-rest-api.md) guide.
19
19
20
20
## Prerequisites
21
21
22
-
To get started, you'll need:
22
+
To get started, you need:
23
23
24
24
* An active [**Azure account**](https://azure.microsoft.com/free/cognitive-services/). If you don't have one, you can [**create a free account**](https://azure.microsoft.com/free/).
25
25
@@ -28,7 +28,7 @@ To get started, you'll need:
28
28
* An [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM). You'll [**create containers**](../../../../storage/blobs/storage-quickstart-blobs-portal.md#create-a-container) in your Azure blob storage account for your source and target files:
29
29
30
30
***Source container**. This container is where you upload your files for translation (required).
31
-
***Target container**. This container is where your translated files will be stored (required).
31
+
***Target container**. This container is where your translated files are stored (required).
32
32
33
33
* You also need to create Shared Access Signature (SAS) tokens for your source and target containers. The `sourceUrl` and `targetUrl` , must include a Shared Access Signature (SAS) token, appended as a query string. The token can be assigned to your container or specific blobs. *See*[**Create SAS tokens for Document Translation process**](create-sas-tokens.md).
34
34
@@ -103,7 +103,7 @@ using System;
103
103
usingSystem.Threading;
104
104
```
105
105
106
-
In the application's **Program** class, create variables for your key and custom endpoint. For details, *see*[Custom domain name and key](../quickstarts/get-started-with-rest-api.md#your-custom-domain-name-and-key)
106
+
In the application's **Program** class, create variables for your key and custom endpoint. For more information, *see*[Retrieve your key and custom domain endpoint](../quickstarts/get-started-with-rest-api.md#retrieve-your-key-and-document-translation-endpoint).
* To Start a translation operation for one or more documents in a single blob container, you'll call the `StartTranslationAsync` method.
115
+
* To Start a translation operation for one or more documents in a single blob container, you call the `StartTranslationAsync` method.
116
116
117
117
* To call `StartTranslationAsync`, you need to initialize a `DocumentTranslationInput` object that contains the following parameters:
118
118
119
119
***sourceUri**. The SAS URI for the source container containing documents to be translated.
120
-
***targetUri** The SAS URI for the target container to which the translated documents will be written.
120
+
***targetUri** The SAS URI for the target container to which the translated documents are written.
121
121
***targetLanguageCode**. The language code for the translated documents. You can find language codes on our [Language support](../../language-support.md) page.
122
122
123
123
```csharp
@@ -185,8 +185,7 @@ from azure.core.credentials import AzureKeyCredential
185
185
from azure.ai.translation.document import DocumentTranslationClient
186
186
```
187
187
188
-
Create variables for your resource key, custom endpoint, sourceUrl, and targetUrl. For
189
-
more information, *see*[Custom domain name and key](../quickstarts/get-started-with-rest-api.md#your-custom-domain-name-and-key)
188
+
Create variables for your resource key, custom endpoint, sourceUrl, and targetUrl. For more information, *see*[Retrieve your key and custom domain endpoint](../quickstarts/get-started-with-rest-api.md#retrieve-your-key-and-document-translation-endpoint).
Copy file name to clipboardExpand all lines: articles/cognitive-services/Translator/document-translation/how-to-guides/use-rest-api-programmatically.md
* An active [**Azure account**](https://azure.microsoft.com/free/cognitive-services/). If you don't have one, you can [**create a free account**](https://azure.microsoft.com/free/).
33
33
34
-
* An [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM). You create containers to store and organize your blob data within your storage account.
34
+
* An [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM). You also need to [create containers](#create-azure-blob-storage-containers) in your Azure blob storage account for your source and target files:
35
+
36
+
***Source container**. This container is where you upload your files for translation (required).
37
+
***Target container**. This container is where your translated files are stored (required).
35
38
36
39
* A [**single-service Translator resource**](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) (**not** a multi-service Cognitive Services resource):
37
40
@@ -56,26 +59,19 @@ To get started, you need:
56
59
57
60
1. After your resource has successfully deployed, select **Go to resource**.
58
61
59
-
## Your custom domain name and key
60
-
61
-
> [!IMPORTANT]
62
-
>
63
-
> ***All API requests to the Document Translation service require a custom domain endpoint**.
64
-
> * You won't use the endpoint found on your Azure portal resource _Keys and Endpoint_ page nor the global translator endpoint—`api.cognitive.microsofttranslator.com`—to make HTTP requests to Document Translation.
62
+
### Retrieve your key and custom domain endpoint
65
63
66
-
### What is the custom domain endpoint?
64
+
*Requests to the Translator service require a read-only key and custom endpoint to authenticate access. The custom domain endpoint is a URL formatted with your resource name, hostname, and Translator subdirectories and is available in the Azure portal.
67
65
68
-
The custom domain endpoint is a URL formatted with your resource name, hostname, and Translator subdirectories:
66
+
1. If you've created a new resource, after it deploys, select **Go to resource**. If you have an existing Document Translation resource, navigate directly to your resource page.
1. In the left rail, under *Resource Management*, select **Keys and Endpoint**.
73
69
74
-
### Find your custom domain name
70
+
1. Copy and paste your **`key`** and **`document translation endpoint`** in a convenient location, such as *Microsoft Notepad*. Only one key is necessary to make an API call.
75
71
76
-
The **NAME-OF-YOUR-RESOURCE**(also called *custom domain name*) parameter is the value that you entered in the **Name** field when you created your Translator resource.
72
+
1. You **`key`**and **`document translation endpoint`** into the code samples to authenticate your request to the Document Translation service.
77
73
78
-
:::image type="content" source="../../media/instance-details.png" alt-text="Image of the Azure portal, create resource, instant details, name field.":::
74
+
:::image type="content" source="../media/document-translation-key-endpoint.png" alt-text="Screenshot showing the get your key field in Azure portal.":::
* An active [**Azure account**](https://azure.microsoft.com/free/cognitive-services/). If you don't have one, you can [**create a free account**](https://azure.microsoft.com/free/).
34
34
35
-
* An [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM). You also need to create containers to store and organize your blob data within your storage account.
35
+
* An [**Azure blob storage account**](https://portal.azure.com/#create/Microsoft.StorageAccount-ARM). You also need to [create containers](#create-azure-blob-storage-containers) in your Azure blob storage account for your source and target files:
36
+
37
+
***Source container**. This container is where you upload your files for translation (required).
38
+
***Target container**. This container is where your translated files are stored (required).
36
39
37
40
* A [**single-service Translator resource**](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) (**not** a multi-service Cognitive Services resource):
38
41
@@ -57,29 +60,20 @@ To get started, you need:
57
60
58
61
1. After your resource has successfully deployed, select **Go to resource**.
59
62
60
-
## Your custom domain name and key
61
-
62
-
The custom domain endpoint is a URL formatted with your resource name, hostname, and Translator subdirectories and is available in the Azure portal.
63
-
64
-
> [!IMPORTANT]
65
-
>
66
-
> ***All API requests to the Document Translation service require a custom domain endpoint**.
67
-
> * Don't use the Text Translation endpoint found on your Azure portal resource *Keys and Endpoint* page nor the global translator endpoint—`api.cognitive.microsofttranslator.com`—to make HTTP requests to Document Translation.
68
-
69
63
> [!div class="nextstepaction"]
70
64
> [I ran into an issue with the prerequisites.](https://microsoft.qualtrics.com/jfe/form/SV_0Cl5zkG3CnDjq6O?Pillar=Language&Product=Document-translation&Page=quickstart&Section=Prerequisites)
71
65
72
-
### Retrieve your key and endpoint
66
+
### Retrieve your key and document translation endpoint
73
67
74
-
Requests to the Translator service require a read-only key and custom endpoint to authenticate access.
68
+
*Requests to the Translator service require a read-only key and custom endpoint to authenticate access. The custom domain endpoint is a URL formatted with your resource name, hostname, and Translator subdirectories and is available in the Azure portal.
75
69
76
70
1. If you've created a new resource, after it deploys, select **Go to resource**. If you have an existing Document Translation resource, navigate directly to your resource page.
77
71
78
72
1. In the left rail, under *Resource Management*, select **Keys and Endpoint**.
79
73
80
74
1. Copy and paste your **`key`** and **`document translation endpoint`** in a convenient location, such as *Microsoft Notepad*. Only one key is necessary to make an API call.
81
75
82
-
1. You **`key`** and **`document translation endpoint`** into the code samples to authenticate your request to the Document Translation service.
76
+
1. You paste your **`key`** and **`document translation endpoint`** into the code samples to authenticate your request to the Document Translation service.
83
77
84
78
:::image type="content" source="../media/document-translation-key-endpoint.png" alt-text="Screenshot showing the get your key field in Azure portal.":::
0 commit comments