question

AbdullahSafdarAli-5044 avatar image
0 Votes"
AbdullahSafdarAli-5044 asked romungi-MSFT commented

Microsoft Document Translator API target file empty

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-blob-storageazure-translatorazure-storage-explorer
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@AbdullahSafdarAli-5044 Did you get a chance to try the scenario again with a different name? If this still fails, is it possible to share the file to replicate the issue?

0 Votes 0 ·

1 Answer

romungi-MSFT avatar image
0 Votes"
romungi-MSFT answered romungi-MSFT commented

@AbdullahSafdarAli-5044 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.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ISame even if the name is changed. SAS target signature permissions include write and list as per documentation

0 Votes 0 ·
romungi-MSFT avatar image romungi-MSFT AbdullahSafdarAli-5044 ·

@AbdullahSafdarAli-5044 Is it possible to share your document if it is not confidential? I think this issue needs to be replicated to check what could be wrong with your file.

0 Votes 0 ·

I tried with 2,3 different documents. The error stayed, I believe the problem is with Azure resource

0 Votes 0 ·
Show more comments