# Enable Custom Translator with VNet integration

# Create a New Public Translator Resource

  1. Create a public Translator resource and ensure “Allow public access” is checked.
    alt text

  2. Create a private endpoint.
    alt text

# Add Workspace in Custom Translator Portal

  1. Create a workspace.
    alt text

  2. Obtain the Workspace ID.
    alt text

# Create a VM in the VNet, ensure this VM can connect to the private endpoint

alt text

# Enable Custom Translator for VNet Integration

  1. Set “Firewalls and virtual networks” to “Selected networks and private endpoints”, then add the subnet of the VM from step 3. Once added, Custom Translator will be enabled for VNet integration (this can be changed to “Disabled” after all settings are complete).

Reference: Enable Custom Translator through Azure Virtual Network

# Recreate Workspace for VNet Integration in Command Prompt on VM

  1. Create a workspace with the same name as the one created in step 2.1
1
2
// Create a workspace
curl.exe -X POST "https://<resource-name>.cognitiveservices.azure.com/translator/customtranslator/api/texttranslator/v1.0/workspaces" --header "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key:<resource-key>" --data "{ 'Name': '<workspace-name>', 'Subscription': { 'SubscriptionKey': '<resource-key>', 'BillingRegionCode': '<billing-region-code>' } }"

alt text

  1. Get supported language codes
1
2
// get supported LanguagePairId code
curl.exe -X GET "https://<resource-name>.cognitiveservices.azure.com/translator/customtranslator/api/texttranslator/v1.0/languages/supportedlanguagepairs" --header "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key:<resource-key>"

alt text

  1. Create a project using the Workspace ID obtained in step 2.2. The sourceLanguageCode and targetLanguageCode can be found using the supported language codes from step 5.2
1
2
// get supported LanguagePairId code
curl.exe -X GET "https://<resource-name>.cognitiveservices.azure.com/translator/customtranslator/api/texttranslator/v1.0/languages/supportedlanguagepairs" --header "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key:<resource-key>"
  1. Open Custom Translator Portal on the VM and confirm the project created in step 5.3 is visible.
    alt text