"Access to the path 'D:\Windows\system32\file is denied" Azure Web 应用程序
"Access to the path 'D:\\Windows\\system32\\file is denied" Azure Web App
我有一个利用 IronPython 的特定函数,在 python 代码中它正在访问当前目录并创建一个临时文件。当它稍后尝试根据相对目录路径访问该文件时,它无法获取它,并且我从 IronPython 收到一条错误消息,指出
"Access to the path 'D:\Windows\system32\file is denied"
('file' 是创建的唯一临时文件)。当我 运行 VS 在本地作为管理员时,这一切都有效。如果我 运行 在本地而不是以管理员身份使用它,我会收到同样的错误。当我将应用程序发布到 Azure 上的应用程序服务时,出现 access denied
错误。
非常感谢您,如果您还有其他问题,请告诉我。
我不会向 C:\Windows\system32 写入内容,因为它们是操作系统文件。无论您是 运行 程序的哪个用户,我都觉得写入本地临时目录会更舒服:
%USERPROFILE%\AppData\Local\Temp
D:\Windows\system32\file is denied
它是在 Azure WebApp 上设计的。沙盒中的 Azure Web 应用程序(以及移动 App/Services、WebJobs 和 Functions)运行。应用程序受到高度限制。如果我们想获得更多关于WebApp的信息,请参考Azure Web App sandbox。
Home directory access (d:\home)
Every Azure Web App has a home directory stored/backed by Azure Storage. This network share is where applications store their content. This directory is available for the sandbox with read/write access.
As a convenience for our customers, the sandbox implements a dynamic symbolic link in kernel mode which maps d:\home to the customer home directory. This is done to remove the need of the customer to keep referencing their own network share path when accessing the site. No matter where the site runs, or how many sites run on a VM, each can access their home directory using d:\home.
Local directory access (d:\local)
Every Azure Web App has a local directory which is temporary and is deleted when the run is no longer running on the VM. This directory is a place to store temporary data for the application. The sandbox implements a dynamic symbolic link which maps d:\local to point to this directory. The application naturally has read/write access to this directory.
Note that the d:\local folder in the scm site (where Kudu runs) is not the same as the one in the main site (where the web app runs). As a result, they cannot see each other's local files.
我有一个利用 IronPython 的特定函数,在 python 代码中它正在访问当前目录并创建一个临时文件。当它稍后尝试根据相对目录路径访问该文件时,它无法获取它,并且我从 IronPython 收到一条错误消息,指出
"Access to the path 'D:\Windows\system32\file is denied"
('file' 是创建的唯一临时文件)。当我 运行 VS 在本地作为管理员时,这一切都有效。如果我 运行 在本地而不是以管理员身份使用它,我会收到同样的错误。当我将应用程序发布到 Azure 上的应用程序服务时,出现 access denied
错误。
非常感谢您,如果您还有其他问题,请告诉我。
我不会向 C:\Windows\system32 写入内容,因为它们是操作系统文件。无论您是 运行 程序的哪个用户,我都觉得写入本地临时目录会更舒服: %USERPROFILE%\AppData\Local\Temp
D:\Windows\system32\file is denied
它是在 Azure WebApp 上设计的。沙盒中的 Azure Web 应用程序(以及移动 App/Services、WebJobs 和 Functions)运行。应用程序受到高度限制。如果我们想获得更多关于WebApp的信息,请参考Azure Web App sandbox。
Home directory access (d:\home)
Every Azure Web App has a home directory stored/backed by Azure Storage. This network share is where applications store their content. This directory is available for the sandbox with read/write access.
As a convenience for our customers, the sandbox implements a dynamic symbolic link in kernel mode which maps d:\home to the customer home directory. This is done to remove the need of the customer to keep referencing their own network share path when accessing the site. No matter where the site runs, or how many sites run on a VM, each can access their home directory using d:\home.
Local directory access (d:\local)
Every Azure Web App has a local directory which is temporary and is deleted when the run is no longer running on the VM. This directory is a place to store temporary data for the application. The sandbox implements a dynamic symbolic link which maps d:\local to point to this directory. The application naturally has read/write access to this directory.
Note that the d:\local folder in the scm site (where Kudu runs) is not the same as the one in the main site (where the web app runs). As a result, they cannot see each other's local files.