gpt4 book ai didi

c# - "Access to the path ' D :\\Windows\\system32\\file is denied"Azure Web App

转载 作者:太空宇宙 更新时间:2023-11-03 22:54:01 25 4
gpt4 key购买 nike

我有一个利用 IronPython 的特定函数,在 python 代码中它正在访问当前目录并创建一个临时文件。当它稍后尝试根据相对目录路径访问该文件时,它无法获取该文件,并且我收到了来自 IronPython 的错误,其中指出 “访问路径 'D:\Windows\system32\file 被拒绝”('file' 是创建的唯一临时文件)。当我以管理员身份在本地运行 VS 时,这一切都有效。如果我在本地而不是以管理员身份运行它,我会收到相同的错误。当我将应用程序发布到 Azure 上的应用服务时,出现访问被拒绝错误。

提前非常感谢您,如果您还有任何其他问题,请告诉我。

最佳答案

D:\Windows\system32\file is denied

它是在 Azure WebApp 上设计的。 Azure Web 应用程序(以及移动应用程序/服务、Web 作业和函数)在沙箱中运行。应用程序受到严格限制。如果我们想了解更多关于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.

关于c# - "Access to the path ' D :\\Windows\\system32\\file is denied"Azure Web App,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46335180/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com