Skip to content

Latest commit

 

History

History
74 lines (50 loc) · 5.08 KB

File metadata and controls

74 lines (50 loc) · 5.08 KB
title titleSuffix description author manager ms.service ms.custom ms.topic ms.date ms.author zone_pivot_groups
Batch Document Translation C#/.NET or Python client library
Azure AI services
Use the Batch Document Translator C#/.NET or Python client library (SDK) for cloud-based batch document translation service and process.
laujan
nitinme
azure-ai-translator
devx-track-dotnet, devx-track-python
quickstart
06/27/2024
lajanuar
programming-languages-document-sdk

Get started: Document Translation client libraries

Document Translation is a cloud-based feature of the Azure AI Translator service that asynchronously translates whole documents in supported languages and various file formats. In this quickstart, learn to use Document Translation with a programming language of your choice to translate a source document into a target language while preserving structure and text formatting.

Important

  • Document Translation is currently supported in the Translator (single-service) resource only, and is not included in the Azure AI services (multi-service) resource.
  • Document Translation is supported in paid tiers. The Language Studio supports the S1 or D3 instance tiers. We suggest that you select Standard S1 to try Document Translation. See Azure AI services pricing—Translator.
  • Document Translation public preview releases provide early access to features that are in active development. Features, approaches, and processes may change, prior to General Availability (GA), based on user feedback.
  • The public preview version of Document Translation client libraries default to REST API version 2024-05-01.

Prerequisites

To get started, you need:

  • An active Azure account. If you don't have one, you can create a free account.

  • A single-service Translator resource (not a multi-service Azure AI services resource). If you're planning on using the Document Translation feature with managed identity authorization, choose a geographic region such as East US. Select the Standard S1 Standard Service Plan (Pay-as-you-go) or C2, C3, C4, or D3 Volume Discount Plans.

  • An Azure Blob Storage account. You'll create containers in your Azure Blob Storage account for your source and target files:

    • Source container. This container is where you upload your files for translation (required).
    • Target container. This container is where your translated files are stored (required).

Storage container authorization

You can choose one of the following options to authorize access to your Translator resource.

✔️ Managed Identity. A managed identity is a service principal that creates a Microsoft Entra identity and specific permissions for an Azure managed resource. Managed identities enable you to run your Translator application without having to embed credentials in your code. Managed identities are a safer way to grant access to storage data and replace the requirement for you to include shared access signature tokens (SAS) with your source and target URLs.

To learn more, see Managed identities for Document Translation.

:::image type="content" source="../media/managed-identity-rbac-flow.png" alt-text="Screenshot of managed identity flow (RBAC).":::

✔️ Shared Access Signature (SAS). A shared access signature is a URL that grants restricted access for a specified period of time to your Translator service. To use this method, you 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.

  • Your source container or blob must designate read and list access.
  • Your target container or blob must designate write and list access.

To learn more, see Create SAS tokens.

:::image type="content" source="../media/sas-url-token.png" alt-text="Screenshot of a resource URI with a SAS token.":::

::: zone pivot="programming-language-csharp"

[!INCLUDE C# programming] ::: zone-end

::: zone pivot="programming-language-python"

[!INCLUDE Python programming] ::: zone-end

Next step

[!div class="nextstepaction"] Learn more about Document Translation operations