Document Translator Access Error

Simon Temby 6 Reputation points
2021-09-26T03:46:09.45+00:00

I am using AML to run python to translate documents (document translator) given the current bug, i am using the region endpoint (endpoint = "https://australiaeast.api.cognitive.microsoft.com/translator/text/batch/v1.0")

The request sends (I get a 202) response.

When I run python to get the job status, I receive 200 :

"200
{"id":"b2e26de0-55c0-44c4-83ca-5c4315ec5bcd","createdDateTimeUtc":"2021-09-26T03:33:19.9387768Z","lastActionDateTimeUtc":"2021-09-26T03:33:20.5718544Z","status":"ValidationFailed","error":{"code":"InvalidRequest","message":"Cannot access source document location with the current permissions.","target":"Operation","innerError":{"code":"InvalidDocumentAccessLevel","message":"Cannot access source document location with the current permissions."}},"summary":{"total":0,"failed":0,"success":0,"inProgress":0,"notYetStarted":0,"cancelled":0,"totalCharacterCharged":0}}"

I am using a SAS generated URL+ URI from Storage Explorer, and have also tried to use SAS tokens generated from Azure Portal. I am generating these tokens at the Container level, as I'm trying to translate 3 documents.

Anyway I try to generate a SAS token, it always send fine, but I always get the above error. I even attempted to use a file specific SAS.

I am not using the user delegate SAS token in the portal. I haven't set up anything else in my Azure portal.

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
2,574 questions
Azure Translator
Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
343 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 42,286 Reputation points Microsoft Employee
    2021-09-27T11:32:59.063+00:00

    @Simon Temby I have tried this scenario with couple of files in a container, 1 PDF and 1 .txt file. The body of the request I used for this scenario is:

    {  
        "inputs": [  
            {  
                "source": {  
                    "sourceUrl": "https://<myblob>.blob.core.windows.net/translator?sp=rl&st=2021-09-27T11:17:06Z&se=2021-09-27T19:17:06Z&spr=https&sv=2020-08-04&sr=c&sig=tiUsV%2Ba95O%2BzoeuvamgZHwqdyFsXCydn%2FP6uZIkon80%3D"  
                },  
                "targets": [  
                    {  
                        "targetUrl": "https://<myblob>.blob.core.windows.net/target?sp=rwl&st=2021-09-27T11:19:15Z&se=2021-09-27T19:19:15Z&spr=https&sv=2020-08-04&sr=c&sig=BL0bfpBiMXCTbhrsSAn8FxYtbAkDXvVgysteiDNgLns%3D",  
                        "language": "de"  
                    }  
                ]  
            }  
        ]  
    }  
    

    In both cases the source and target access is delegated as SAS access at the container level.
    Once the request was submitted the get status operation returned success for both the documents. I have created a new target container in this case as the error you mentioned seems to occur for some of my older containers.

    I would request to check the body of your request as above and create a new target container and use that SAS URL in the body to check if this works. Thanks.

    If an answer is helpful, please click on 130616-image.png or upvote 130671-image.png which might help other community members reading this thread.

    1 person found this answer helpful.