I have an Azure Function that is running in Linux (Consumption plan). I have also enabled SCM_DO_BUILD_DURING_DEPLOYMENT by setting its value to true in my environment variables. The Function app has a dependency on Playwright where it needs to run Chrome browser to do some work. I am deploying the code using Github Actions. Everything works great as far as deployment is concerned however when I run my Function code to invoke Chrome, I am getting EACCES error.
I know that this issue is related to the lack of Execute access. When I check the permissions on all files and folders inside my .local_browsers folder, I see that all folders have 755 permission however all files have 644 permission.
The issue I am running into is no matter what I do, I cannot change the permissions on the files from 644 to 755.
I have the following in my GitHub Action workflow file:
I even added a custom startup script and calling it as prestart script but still the permissions are not changed:
#!/bin/bash
# Define the path
LOCAL_BROWSERS_PATH="/home/site/wwwroot/node_modules/playwright-core/.local-browsers"
# Check if the directory exists
if [ -d "$LOCAL_BROWSERS_PATH" ]; then
# If the file exists, change its permissions
# chmod -R +x "$LOCAL_BROWSERS_PATH"
find "$LOCAL_BROWSERS_PATH" -type d -exec chmod 755 {} \;
find "$LOCAL_BROWSERS_PATH" -type f -exec chmod 755 {} \;
echo "Permissions updated for $LOCAL_BROWSERS_PATH"
else
# If the file doesn't exist, print a message and exit successfully
echo "Chrome executable not found at $LOCAL_BROWSERS_PATH. Skipping permission change."
fi
I am at a complete loss of ideas here as to what I am doing wrong.
I have an Azure Function that is running in Linux (Consumption plan). I have also enabled
SCM_DO_BUILD_DURING_DEPLOYMENT
by setting its value totrue
in my environment variables. The Function app has a dependency onPlaywright
where it needs to run Chrome browser to do some work. I am deploying the code using Github Actions. Everything works great as far as deployment is concerned however when I run my Function code to invoke Chrome, I am gettingEACCES
error.Here's my error stack trace:
I know that this issue is related to the lack of
Execute
access. When I check the permissions on all files and folders inside my.local_browsers
folder, I see that all folders have755
permission however all files have644
permission.The issue I am running into is no matter what I do, I cannot change the permissions on the files from
644
to755
.I have the following in my GitHub Action workflow file:
This does not throw any error but it does not change the permission as well.
FWIW, here's my complete workflow:
I even added a custom startup script and calling it as
prestart
script but still the permissions are not changed:I am at a complete loss of ideas here as to what I am doing wrong.
P.S. It is a cross-posting. I originally posted this on StackOverflow a few days ago. Posting it here because I did not get any response there. StackOverflow post can be found here: https://stackoverflow.com/questions/78909340/unable-to-set-execute-permissions-on-files-in-azure-function.