Azure.RequestFailedException: 'Cannot access source document location with the current permissions. Status: 200 (OK) ErrorCode: InvalidRequest

Eduardo Gomez 3,431 Reputation points
2022-09-30T03:37:00.117+00:00

I have two containers in Azure storage, in order to do translations

original and transcribed, they are containers, because I need to access it

I have a method, to upload my document

    public async Task<Uri> UploadToAzureBlobStorage(string FilePath) {  

            ContainerClient = new BlobContainerClient(ConectionString, Constants.AZURE_CONTAINER_ORIGINAL_DOCUMENT);  

            var blob = ContainerClient.GetBlobClient(Path.GetFileName(FilePath));  
            await blob.UploadAsync(FilePath, true);  

            return new Uri($"https://transcribemedocs.blob.core.windows.net/original{Path.GetFileName(FilePath)}");  
        }  

The document gets uploaded successfully (https://transcribemedocs.blob.core.windows.net/original/Articulo 6 (1).docx)

I have declared a method for translating the document

   public static async Task TranslatorAsync(Uri sourceUrl, Uri TargetUrl, string language = "en") {  

            DocumentTranslationClient client = new(new Uri(Constants.ENDPOINT), new AzureKeyCredential(Constants.KEY));  

            var input = new DocumentTranslationInput(sourceUrl, TargetUrl, language);  

            DocumentTranslationOperation operation = await client.StartTranslationAsync(input);  

            await operation.WaitForCompletionAsync();  

        }  

I got this error

Azure.RequestFailedException: 'Cannot access source document location with the current permissions.

Status: 200 (OK)
ErrorCode: InvalidRequest

246336-image.png

But when I go o the URL, I got this error

246337-image.png

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,999 questions
Azure Translator
Azure Translator
An Azure service to easily conduct machine translation with a simple REST API call.
428 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,145 questions
{count} vote

Accepted answer
  1. Sumarigo-MSFT 47,376 Reputation points Microsoft Employee
    2022-09-30T16:59:13.733+00:00

    @Eduardo Gomez Welcome to Microsoft Q&A Forum, Thank you for posting your query here!

    I see you have posted the similar query in SO forum: https://stackoverflow.com/questions/73905176/azure-requestfailedexception-cannot-access-source-document-location-with-the-cutried

    Have you tried the suggestion mentioned over there? If the issue still persist, I would like to work closer on this issue.

    If you have any additional questions or need further clarification, please let me know.

    ----------

    Please do not forget to 246534-screenshot-2021-12-10-121802.pngand “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


0 additional answers

Sort by: Most helpful

Your answer

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