Hi! Thank you for your help in advance!
I am experiencing an issue with one of the function applications I am currently developing. The codebase can be found here
This application converts PowerPoints to a .pro format for a presentation software called ProPresenter.
Currently, I am achieving that result by running the data from PowerPoint through a specialized compiler (Google Protoc) to create the binary for the .pro file.
The application flow is as follows:
- PowerPoint is updated in a SharePoint site in my M365 tenant.
- A Power Platform app takes the information about the PowerPoint and invokes my Azure Function via an HTTP trigger.
- Azure Function retrieves an access token by using credentials set in ENV.
- Azure Function downloads the PowerPoint and extracts text information from it.
- Azure Function converts the text data into format required for the Protoc compiler.
- Azure Function uses the Protoc compiler to convert the data into the binary format required for the .pro file
- Azure Function saves the file in the temp directory of the Azure Function
- Azure Function uploads the file back to the SharePoint site.
A few considerations:
I am a beginner developer and this is my second Azure Function. The code I have written may seem weird or outright bad. I apologize as I am still learning.
One thing in particular is, I had trouble making sure that my function runs sequentially / synchronously, and so I have added a custom sleep() function to ensure that tasks are executed sequentially. I am aware of the await / async approach, but I have so far not been able to figure out how to get it to work the way I expect.
Currently, the function goes through the whole process up until the data needs to be converted into the binary and saved to a .pro file. It then stops with an empty error trace. This makes me think that an error occurs during the convertToPresentation() function.
Here is the whole process being logged:
2025-01-14T22:19:32.824 [Information] Request Received: {
"driveId":"********",
"driveItemId": "*******"
}
2025-01-14T22:19:34.677 [Information] Retrieving file information...
2025-01-14T22:19:34.902 [Information] Retrieved file information successfully.
2025-01-14T22:19:34.902 [Information] Downloading file...
2025-01-14T22:19:35.028 [Information] File downloaded successfully.
2025-01-14T22:19:35.028 [Information] Converting response to buffer...
2025-01-14T22:19:35.033 [Information] File buffer size: 47072
2025-01-14T22:19:38.113 [Information] Extracting text from file...
2025-01-14T22:19:38.113 [Information] Text extracted from file successfully.
2025-01-14T22:19:40.284 [Error] Executed 'Functions.fileIsModified' (Failed, Id=ff37f58c-5e8b-4892-9ff6-427ec86a60c4, Duration=7658ms)
I have Application Insights enabled, but the messages there do not show any more details. Application Insights also does not show any error events and shows the exit event as informational (as I am judging by the color green), although the event is marked as an error in severity. 
I have also attempted to look at the logs through VS Code, as well as log streaming in the Azure Portal, but am not seeing any more information about this.
Is there anything else I could do to see what the issue is?
Hoping someone can assist!
Thank you!