我将如何写入 Windows azure 网站中的 tmp/temp 目录?我可以写入 blob,但我使用的 NPM 需要我为其提供文件名,以便它可以直接写入这些文件名。
2 回答
Are you using Cloud Services (PaaS) or Virtual Machines (IaaS).
If PaaS, look at Windows Azure Local Storage. This option gives you up to 250gb of disk space per core. Its a great location for temporary storage of information in a way that traditional apps will be familiar with. However, its not persistent so if you put anything there you need to make sure will be available if the VM instance gets repaved, then copy it to Blob storage. Also, this storage is specific to a given role instance. So if you have two instances of the same role, they each have their own local storage buckets.
Alternatively, you can use Azure Drive, which allows you to keep the information persisted, but still doesn't allow multiple parallel writes.
If IaaS, then you can just mount a data disk to the VM and write to it directly. Data disks are already persisted to blob storage so there's little risk of data loss.
仅根据我的理解,如果有任何问题,请纠正我。
在 Windows Azure 网站中,您网站的内容将存储在 blob 存储中并作为驱动器安装,该驱动器将用于您的网站正在使用的所有实例。而且由于它在 blob 存储中,因此它是持久的。因此,如果您需要本地文件系统,我认为您可以使用网站根路径下的文件夹。但我不认为你可以使用系统tmp
或temp
文件夹。