Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6606045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:21:15+00:00 2026-05-25T19:21:15+00:00

I use local storage on Windows Azure to store temporary files. In there I

  • 0

I use local storage on Windows Azure to store temporary files. In there I call an .exe file to make a conversion of several other files in same local storage folder. Problem is I always get the exception “Access to the path XYZ.exe is denied.”.

I should mention the following:
– I am using a worker role
– set in the service definition file

and tried to add permission to the folder I am accessing:

    public static void AddPermission(string absoluteFolderPath)
    {
        DirectoryInfo myDirectoryInfo = new DirectoryInfo(absoluteFolderPath);

        DirectorySecurity myDirectorySecurity = myDirectoryInfo.GetAccessControl();
        myDirectorySecurity.AddAccessRule(new FileSystemAccessRule(
        "NETWORK SERVICE",
        FileSystemRights.FullControl,
        AccessControlType.Allow));
        myDirectoryInfo.SetAccessControl(myDirectorySecurity);
    }

UPDATE:
I tried with this code now:

     public static void FixPermissions()
    {
        var tempDirectory = RoleEnvironment.GetLocalResource("localStorage").RootPath;
        Helper.addPermission(tempDirectory);

        var dir = new DirectoryInfo(tempDirectory);
        foreach (var d in dir.GetDirectories())
            Helper.addPermission(d.FullName);
    }

    private  static void addPermission(string path)
    {
        FileSystemAccessRule everyoneFileSystemAccessRule = new FileSystemAccessRule("Everyone", 
                                                                                     FileSystemRights.FullControl,
                                                                                     InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit,
                                                                                     PropagationFlags.None, AccessControlType.Allow);
        DirectoryInfo directoryInfo = new DirectoryInfo(path);
        DirectorySecurity directorySecurity = directoryInfo.GetAccessControl();
        directorySecurity.AddAccessRule(everyoneFileSystemAccessRule);
        directoryInfo.SetAccessControl(directorySecurity);
    }

I get a really strange behaviour of the page. I still get the errors but sometimes some files gets converted by the ffmpeg.exe file.

Can someone help me out here??

Thanks a lot.

SOLUTION:

So seems the problem was that I ran the .exe file within local storage and therefore had the given security issues. Putting the .exe into the application and referring directly solved my issue.

Thx for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T19:21:16+00:00Added an answer on May 25, 2026 at 7:21 pm

    By default your worker role will most likely not be running with sufficient privilege to allow changes to the access control lists on Azure folders.

    There’s two possible options:

    • Best: run a script at startup to set the permissions. Details are on MSDN here: http://msdn.microsoft.com/en-us/library/gg456327.aspx. You’ll want to set executionContext="elevated".

      The best way to write the script itself is through Powershell. An example is here: http://weblogs.thinktecture.com/cweyer/2011/01/fixing-windows-azure-sdk-13-full-iis-diagnostics-and-tracing-bug-with-a-startup-task-a-grain-of-salt.html. Alternatively, write a console application to do the same thing.

    • Easiest, but much less secure: set the security in your OnStart method, and run your whole worker role elevated: in your service definition file include

    <WebRole name="WebApplication2">
      <Runtime executionContext="elevated" />
      <Sites>
    

    However, I’d really not recommend that as it’s a terrible security hole for something that’s running in the public cloud.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried to use Boost thread local storage with Windows threads. I built the
Other than convention, is there any reason to use or not to use local
I am working with Windows Azure and am just using the Blob Storage. I
I want to use local session storage to maintain state in my web app,
Our app is hosted at Heroku, so no local file storage. A third party
supppose I use html5 local storage for my website. 1)can End user see my
I am trying to use local port forwarding to access remote host over a
I have started a new mvc project and clicked on project\properties\web - use local
I'm trying to debug an ASP.NET webapp that's configured to Use Local IIS Web
I currently use my local web server to allow costumers to preview some applications

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.