Share via

Microsoft Document Translator API target file empty

Abdullah Safdar Ali 1 Reputation point
2021-07-11T20:26:35.957+00:00

Hello.
I was able to make a 202 request using postman through endpoint https://<Name of resource>.cognitiveservices.azure.com/translator/text/batch/v1.0/batches but I see an empty file in the blob. When I query the Get translated status endpoint it shows the status as failed. I don't see any reason why is that. The Json body for the request was:

{
    "inputs": [
        {
            "storageType": "file",
            "source": {
                "sourceUrl": "https://<name of resource>.blob.core.windows.net/source/S0003598X20000265a.pdf?sv=2020-04-08&st=2021-07-11&se=2021-07-12%3A39%3A57Z&sr=b&sp=r&sig="
            },
            "targets": [
                {   
                    "targetUrl": "https://<name of resource>.blob.core.windows.net/target/target.pdf?sv=2020-04-08&st=2021-07-11&se=2021-07-12&sr=c&sp=wl&sig=",
                    "language": "ar"
                }
            ]
        }
    ]
}

sourceUrl was SAS for the document and targetUrl was SAS for the blob.

Azure Storage Explorer
Azure Storage Explorer

An Azure tool that is used to manage cloud storage resources on Windows, macOS, and Linux.

Azure Blob Storage
Azure Blob Storage

An Azure service that stores unstructured data in the cloud as blobs.

Azure Translator in Foundry Tools

1 answer

Sort by: Most helpful
  1. Rohit Mungi 49,131 Reputation points Microsoft Employee Moderator
    2021-07-13T11:34:48.497+00:00

    @Abdullah Safdar Ali Does your target container contain a file called target.pdf already? If that is the case then that is the most probable cause of the failure. You could try a different target name for your file in the target container. Please ensure the required permissions are allocated to the SAS signature of your target container though.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.