Dev diary - 8. April 2025

Azure error madness

header_image

Dear Diary,

Recently, we’ve been building an application that utilizes the Azure Translation service to translate user documents. Once a document is uploaded to the application, it is stored in Azure Blob Storage. In the translation job, a link to the file is passed to the translator.

What could go wrong?

Everything seemed to be working well until some developers started getting an InvalidDocumentAccessLevel error, while others had no issues. The detailed error message reported: "Cannot access source document location with the current permissions."

Some errors are not what they seem to be.

We started investigating the permissions and access between the services. In the meantime, we discovered that a local hotfix was possible by generating a document URL with a SAS token (access token). That confirmed our suspicion that the issue was related to permissions.

What was the actual issue?

After some time, we noticed that files without spaces in their names were working fine. Diving deeper into this direction, it became clear that the issue was with file path encoding—the file name wasn’t being escaped to URL format, while elsewhere in the code, an escaped path was expected.

The result was a document path mismatch—pointing the service to a non-existing storage path (e.g., ../document 08.docx vs ../document%2008.docx). Due to security measures that prevent path guessing, Azure Storage reported a permissions error instead.

blog author
Author
Jozef Radonak

I am at the forefront of Hotovo's web technology stream, striving to stay up to date with the latest web technologies and trends, and always willing to help others master this ever-evolving industry. Outside of the world of web technology, I am an avid hiker and devoted coffee lover. I take great pleasure in seeking out new coffee shops and trying different coffee blends. I am all about innovation, whether in technology or in my cup of coffee!

Read more

Contact us

Let's talk

I hereby consent to the processing of my personal data.