Issues/Errors
409 Conflict: Could not write to local
resource 'D:\home\site\wwwroot\web.config' due to error 'Access to the path is
denied.'.
Not able to Delete and Stop continuous web
jobs from Portal/Kudu.
Cause of the Issue
The above issues/errors occur when we are not
allowed to perform any write operations on wwwroot folder.
The application setting
‘WEBSITE_RUN_FROM_PACKAGE=1’ of the App Service makes the wwwroot folder of the
application as read-only.
If the setting is available in the application
settings of the App Service then we will get 409 conflict error whenever we try
to add/edit any files to the wwwroot folder from App Service Editor or Kudu
console.
When Deleting/Stopping a web job, it tries to
add a file disable.job file to the job folder. If the Web Job is deployed to App_Data folder
of wwwroot folder of the application then adding of disable.job file to the job
folder i.e. App_Data is not supported and hence web job delete/stop operation from
Azure Portal/kudu will be unsuccessful.
When does the setting
‘WEBSITE_RUN_FROM_PACKAGE=1’ get added?
Usually the
setting is added when Run from package deployment is performed to App Service.
Run from Package
deployment means application code will be available as a Zip deployment package in the
d:\home\data\SitePackages (instead of wwwroot folder) and the zip gets mounted on wwwroot as a read-only
file system.
Deploying from
DevOps using App Service Deploy task version 4.0, if no deployment method is
selected, it auto selects the best suitable deployment method based on the
build artifact generated.
If
the artifact generated is Zip file and App Service Deploy Task version is 4.0
then most probably it auto-select Run from Package deployment method (if no
deployment method is selected manually) and add the setting
‘WEBSITE_RUN_FROM_PACKAGE=1’ making wwwroot folder as read-only.
More
details about Run from package deployment can be found on the Url:
Solution
Deploy the
application/web job using other deployment method i.e. MSDeploy, which change the setting value to 0 and make wwwroot
folder writable.
Deleting the
setting ‘WEBSITE_RUN_FROM_PACKAGE’ or changing the setting value to 0.
Note:
Deleting the setting ‘WEBSITE_RUN_FROM_PACKAGE’ or changing the setting value
to 0 implies the application code will now be pointed to wwwroot folder, so
before changing the value to 0 make sure you application code is not
pointing to d:\home\data\SitePackages so as to avoid the situation where
wwwroot folder end up having no files.
Thank you. this error along with Filezilla not showing me the files was driving me crazy.
ReplyDeleteyes, because you might be using Website_run_from_package=1, in that case, your files will be present in Sitepackage folder
Deleteyes, because you might be using Website_run_from_package=1, in that case, your files will be present in Sitepackage folder
ReplyDeleteThanks for the article, really useful. Switching from 1 to 0 allowed on a test env allowed for a quick test to a config change.
ReplyDeleteThanks you saved my day.
ReplyDeleteEl Dorado Resort Casino & Spa - MapYRO
ReplyDeleteEl Dorado Resort Casino & Spa 남원 출장안마 is a casino in El Dorado, California. The casino, 세종특별자치 출장샵 owned and operated by the Rincon Band of 안전 토토 사이트 Luiseno 제주도 출장안마 Indians, features 5500 slot Hotel highlights: Walking distance to El Dorado 충주 출장마사지 Resort Casino and Spa Rating: 7.5/10 · 3,060 reviews · Price range: room rates from $32 per night (USD) - We Price Match!