Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Andrew Rees 6 posts 36 karma points
    Nov 08, 2016 @ 15:35
    Andrew Rees
    0

    Umbraco file permissions when deployed to an Azure cloud service?

    Hi,

    I'm currently trying to configure an Umbraco 7.5 instance to play nicely on a an Azure cloud service. Has anyone successfully got an Umbraco instance to deploy correctly, as my deployments seem to be falling over with file permission issues?

    Access to the path 'E:\sitesroot\0\Config\Dashboard.config' is denied.
    
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
    
    Exception Details: System.UnauthorizedAccessException: Access to the path 'E:\sitesroot\0\Config\Dashboard.config' is denied. 
    
    ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. 
    
    To grant ASP.NET access to a file, right-click the file in File Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.
    

    If this was on a virtual machine, then it wouldn't be an issue as the file permissions can just be adjusted. However on a cloud service this isn't possible, so I can't see how I'm supposed to get around this issue?

    Has anyone else encountered this problem, or found a solution for it?

    Thanks

  • David Redmond 24 posts 76 karma points
    Dec 13, 2016 @ 12:27
    David Redmond
    100

    Hi Andrew,

    You need to setup a deployment script to adjust permissions. Here's the steps for you;

    1. Under your cloud service web role, created a folder called bin
    2. Create a file in this folder called install.cmd
    3. Paste the contents of this into the file

    %windir%\system32\icacls.exe ..\..\sitesroot\0\uSync /t /grant networkservice:f

    1. In your ServiceDefinition.csdef file, add these lines under the WebRole node

      <Startup> <Task commandLine="install.cmd" executionContext="elevated" taskType="simple"> <Environment> <Variable name="ComputeEmulatorRunning"> <RoleInstanceValue xpath="/RoleEnvironment/Deployment/@emulated" /> </Variable> </Environment> </Task> </Startup>

    (formatting went a bit screwed there, apologies)

    Hopefully that's enough to get the file permissions changed on deployment.

    Cheers

  • Andrew Rees 6 posts 36 karma points
    Mar 30, 2017 @ 15:59
    Andrew Rees
    0

    Thanks for this. Sounds a good solution, however in the end I used app services instead and avoided this issue.

  • Muneer 5 posts 75 karma points
    Aug 13, 2020 @ 15:29
    Muneer
    0

    Hi,

    I'm currently trying to configure an Umbraco 8.6.4 instance on a an Azure Web Apps. Has anyone successfully got an Umbraco 8.6.4 instance to deploy correctly, as my deployments seem to be falling over with file permission issues?

    I can't save/publish anything (everything works fine on local , but showing permission issues on azure web apps , Umbraco Health Check shows an error under permissions section as "The following folders must be set up with modify permissions but could not be acccessed AppData, AppData\packages, App_Plugins.") . Any idea ?

    I can confirm that everything fine with the Azure Web Apps set up guidelines described here https://our.umbraco.com/documentation/getting-started/setup/server-setup/azure-web-apps

Please Sign in or register to post replies

Write your reply to:

Draft