Azure asp.net - 为什么 webjob %temp% 文件夹与 web 应用程序 %temp% 文件夹不同?

Azure asp.net - why the webjob %temp% folder is not the same as the web app %temp% folder?

我有一个网络作业,它在映射到 d:\local\temp.

的 %temp% 文件夹中写入一些数据

当我在 Azure 门户上使用控制台工具时,数据就在那里,在 d:\local\temp。

当我尝试访问网站 (asp.net) 上的文件时,文件不存在。但是 %temp% 也映射到 d:\local\temp.

为什么?

是否有映射到相同位置的路径?

我写在本地 %temp% 上的数据是存储在 azure storage blob 上的数据的缓存。如果 %temp% 上的数据丢失,我可以重新创建缓存。

谢谢。

主 Web 应用和 Web 作业 运行 在同一 VM 上的 2 个不同沙盒环境中。他们可以访问相同的 D:\home,但不同的 D:\local

请记住 D:\homeD:\local 是虚拟化路径。它们并不真正存在于文件系统中。这就是为什么您可以 运行 在同一个 VM 上任意多个站点,并且每个站点都有自己的 D:\homeD:\local.

如果您希望他们通过文件系统共享某些内容,则必须将其放在 D:\home