首页 > 解决方案 > Published .net Core Azure app service (Linux) doesn't have permission

问题描述

I have a problem with downloading or executing 'puppeteer-sharp' related files in my Linux web app service. It works on local machine, which means it downloads the last version of Chrome and runs it successfully.

My app is a .net core 5 web app which named 'Web'. Main dll (Web.dll) runs under root user with -rw-r--r-- permission automatically after git push and I can't change the permission with ssh:

chmod: changing permissions of 'Web.dll': Read-only system

Exception message in software is exactly error message in SSH after chmod command:

System.IO.IOException: Read-only file system   
at System.IO.FileSystem.CreateDirectory(String fullPath)   
at PuppeteerSharp.BrowserFetcher.DownloadAsync(String revision)

It has been published with azure CI/CI and disk layout is normal, I mean app service storage.

Run command from Azure app service log stream:

docker run -d -p 5420:8080 --name projectname 
-e WEBSITE_SITE_NAME=projectname -e WEBSITE_AUTH_ENABLED=False 
-e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=projectname.azurewebsites.net 
-e WEBSITE_INSTANCE_ID=xxxx -e HTTP_LOGGING_ENABLED=1 
appsvc/dotnetcore:5.0_20210607.3 dotnet Web.dll 

SSh:

SSH

标签: azureubuntuazure-web-app-service.net-5puppeteer-sharp

解决方案


经过1天的搜索,我找到了答案。

从 Azure 应用服务“应用程序设置”中删除WEBSITE_RUN_FROM_PACKAGE


推荐阅读