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/firewalls.md
+28-4Lines changed: 28 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,33 @@ manager: nitinme
8
8
ms.service: cognitive-services
9
9
ms.subservice: translator-text
10
10
ms.topic: conceptual
11
-
ms.date: 12/06/2021
11
+
ms.date: 04/19/2023
12
12
ms.author: lajanuar
13
13
---
14
14
15
-
# How to translate behind IP firewalls with Translator
15
+
# Use Translator behind firewalls
16
16
17
-
Translator can translate behind firewalls using either domain-name or IP filtering. Domain-name filtering is the preferred method. If you still require IP filtering, we suggest you to get the [IP addresses details using service tag](../../virtual-network/service-tags-overview.md#service-tags-on-premises). Translator is under the **CognitiveServicesManagement** service tag.
17
+
Translator can translate behind firewalls using either [Domain-name](../../firewall/dns-settings.md#configure-dns-proxy---azure-portal) or [IP filtering](#configure-firewall). Domain-name filtering is the preferred method.
18
18
19
-
We **do not recommend** running Microsoft Translator from behind a specific IP filtered firewall. The setup is likely to break in the future without notice.
19
+
If you still require IP filtering, you can get the [IP addresses details using service tag](../../virtual-network/service-tags-overview.md#discover-service-tags-by-using-downloadable-json-files). Translator is under the **CognitiveServicesManagement** service tag.
20
+
21
+
## Configure firewall
22
+
23
+
Navigate to your Translator resource in the Azure portal.
24
+
25
+
1. Select **Networking** from the **Resource Management** section.
26
+
1. Under the **Firewalls and virtual networks** tab, choose **Selected Networks and Private Endpoints**.
27
+
28
+
:::image type="content" source="media/firewall-setting-azure-portal.png" alt-text="Screenshot of the firewall setting in the Azure portal.":::
29
+
30
+
> [!NOTE]
31
+
>
32
+
> * Once you enable **Selected Networks and Private Endpoints**, you must use the **Virtual Network** endpoint to call the Translator. You can't use the standard translator endpoint (`api.cognitive.microsofttranslator.com`) and you can't authenticate with an access token.
33
+
> * For more information, *see*[**Virtual Network Support**](reference/v3-0-reference.md#virtual-network-support).
34
+
35
+
1. To grant access to an internet IP range, enter the IP address or address range (in [CIDR format](https://tools.ietf.org/html/rfc4632)) under **Firewall** > **Address Range**. Only valid public IP (`non-reserved`) addresses are accepted.
36
+
37
+
Running Microsoft Translator from behind a specific IP filtered firewall is **not recommended**. The setup is likely to break in the future without notice.
20
38
21
39
The IP addresses for Translator geographical endpoints as of September 21, 2021 are:
22
40
@@ -25,3 +43,9 @@ The IP addresses for Translator geographical endpoints as of September 21, 2021
Copy file name to clipboardExpand all lines: articles/cognitive-services/Translator/reference/v3-0-reference.md
+23-9Lines changed: 23 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ manager: nitinme
8
8
ms.service: cognitive-services
9
9
ms.subservice: translator-text
10
10
ms.topic: reference
11
-
ms.date: 12/06/2021
11
+
ms.date: 04/20/2023
12
12
ms.author: lajanuar
13
13
---
14
14
@@ -28,16 +28,16 @@ Version 3 of the Translator provides a modern JSON-based Web API. It improves us
28
28
29
29
Requests to Translator are, in most cases, handled by the datacenter that is closest to where the request originated. If there's a datacenter failure when using the global endpoint, the request may be routed outside of the geography.
30
30
31
-
To force the request to be handled within a specific geography, use the desired geographical endpoint. All requests are processed among the datacenters within the geography.
31
+
To force the request to be handled within a specific geography, use the desired geographical endpoint. All requests are processed among the datacenters within the geography.
|Global (non-regional)| api.cognitive.microsofttranslator.com|Closest available datacenter|
35
+
|Global (`non-regional`)| api.cognitive.microsofttranslator.com|Closest available datacenter|
36
36
|Asia Pacific| api-apc.cognitive.microsofttranslator.com|Korea South, Japan East, Southeast Asia, and Australia East|
37
37
|Europe| api-eur.cognitive.microsofttranslator.com|North Europe, West Europe|
38
38
|United States| api-nam.cognitive.microsofttranslator.com|East US, South Central US, West Central US, and West US 2|
39
39
40
-
<sup>1</sup> Customers with a resource located in Switzerland North or Switzerland West can ensure that their Text API requests are served within Switzerland. To ensure that requests are handled in Switzerland, create the Translator resource in the 'Resource region' 'Switzerland North' or 'Switzerland West', then use the resource's custom endpoint in your API requests. For example: If you create a Translator resource in Azure portal with 'Resource region' as 'Switzerland North' and your resource name is 'my-swiss-n', then your custom endpoint is "https://my-swiss-n.cognitiveservices.azure.com". And a sample request to translate is:
40
+
<sup>`1`</sup> Customers with a resource located in Switzerland North or Switzerland West can ensure that their Text API requests are served within Switzerland. To ensure that requests are handled in Switzerland, create the Translator resource in the 'Resource region' 'Switzerland North' or 'Switzerland West', then use the resource's custom endpoint in your API requests. For example: If you create a Translator resource in Azure portal with 'Resource region' as 'Switzerland North' and your resource name is 'my-swiss-n', then your custom endpoint is "https://my-swiss-n.cognitiveservices.azure.com". And a sample request to translate is:
41
41
```curl
42
42
// Pass secret key and region using headers to a custom endpoint
43
43
curl -X POST "https://my-swiss-n.cognitiveservices.azure.com/translator/text/v3.0/translate?to=fr" \
@@ -46,7 +46,7 @@ curl -X POST "https://my-swiss-n.cognitiveservices.azure.com/translator/text/v3.
46
46
-H "Content-Type: application/json" \
47
47
-d "[{'Text':'Hello'}]" -v
48
48
```
49
-
<sup>2</sup> Custom Translator isn't currently available in Switzerland.
49
+
<sup>`2`</sup> Custom Translator isn't currently available in Switzerland.
50
50
51
51
## Authentication
52
52
@@ -60,7 +60,8 @@ There are three headers that you can use to authenticate your subscription. This
60
60
|Authorization|*Use with Cognitive Services subscription if you're passing an authentication token.*<br/>The value is the Bearer token: `Bearer <token>`.|
61
61
|Ocp-Apim-Subscription-Region|*Use with Cognitive Services multi-service and regional translator resource.*<br/>The value is the region of the multi-service or regional translator resource. This value is optional when using a global translator resource.|
62
62
63
-
### Secret key
63
+
### Secret key
64
+
64
65
The first option is to authenticate using the `Ocp-Apim-Subscription-Key` header. Add the `Ocp-Apim-Subscription-Key: <YOUR_SECRET_KEY>` header to your request.
65
66
66
67
#### Authenticating with a global resource
@@ -170,7 +171,7 @@ An authentication token is valid for 10 minutes. The token should be reused when
170
171
|:-----|:----|
171
172
|Authorization| The value is an access **bearer token** generated by Azure AD.</br><ul><li> The bearer token provides proof of authentication and validates the client's authorization to use the resource.</li><li> An authentication token is valid for 10 minutes and should be reused when making multiple calls to Translator.</br></li>*See*[Sample request: 2. Get a token](../../authentication.md?tabs=powershell#sample-request)</ul>|
172
173
|Ocp-Apim-Subscription-Region| The value is the region of the **translator resource**.</br><ul><li> This value is optional if the resource is global.</li></ul>|
173
-
|Ocp-Apim-ResourceId| The value is the Resource ID for your Translator resource instance.</br><ul><li>You'll find the Resource ID in the Azure portal at **Translator Resource → Properties**. </li><li>Resource ID format: </br>/subscriptions/<**subscriptionId**>/resourceGroups/<**resourceGroupName**>/providers/Microsoft.CognitiveServices/accounts/<**resourceName**>/</li></ul>|
174
+
|Ocp-Apim-ResourceId| The value is the Resource ID for your Translator resource instance.</br><ul><li>You find the Resource ID in the Azure portal at **Translator Resource → Properties**. </li><li>Resource ID format: </br>/subscriptions/<**subscriptionId**>/resourceGroups/<**resourceGroupName**>/providers/Microsoft.CognitiveServices/accounts/<**resourceName**>/</li></ul>|
174
175
175
176
##### **Translator property page—Azure portal**
176
177
@@ -238,6 +239,19 @@ Once you turn on this capability, you must use the custom endpoint to call the T
238
239
239
240
You can find the custom endpoint after you create a [translator resource](https://portal.azure.com/#create/Microsoft.CognitiveServicesTextTranslation) and allow access from selected networks and private endpoints.
240
241
242
+
1. Navigate to your Translator resource in the Azure portal.
243
+
1. Select **Networking** from the **Resource Management** section.
244
+
1. Under the **Firewalls and virtual networks** tab, choose **Selected Networks and Private Endpoints**.
245
+
246
+
:::image type="content" source="../media/virtual-network-setting-azure-portal.png" alt-text="Screenshot of the virtual network setting in the Azure portal.":::
247
+
248
+
1. Select **Save** to apply your changes.
249
+
1. Select **Keys and Endpoint** from the **Resource Management** section.
250
+
1. Select the **Virtual Network** tab.
251
+
1. Listed there are the endpoints for Text Translation and Document Translation.
252
+
253
+
:::image type="content" source="../media/virtual-network-endpoint.png" alt-text="Screenshot of the virtual network endpoint.":::
254
+
241
255
|Headers|Description|
242
256
|:-----|:----|
243
257
|Ocp-Apim-Subscription-Key| The value is the Azure secret key for your subscription to Translator.|
@@ -258,8 +272,8 @@ curl -X POST "https://<your-custom-domain>.cognitiveservices.azure.com/translato
258
272
259
273
A standard error response is a JSON object with name/value pair named `error`. The value is also a JSON object with properties:
260
274
261
-
*`code`: A server-defined error code.
262
-
*`message`: A string giving a human-readable representation of the error.
275
+
*`code`: A server-defined error code.
276
+
*`message`: A string giving a human-readable representation of the error.
263
277
264
278
For example, a customer with a free trial subscription would receive the following error once the free quota is exhausted:
0 commit comments