Azure Web App Temp文件清理责任 [英] Azure Web App Temp file cleaning responsibility

查看:86
本文介绍了Azure Web App Temp文件清理责任的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的一个Azure Web App Web API应用程序中,我正在Get方法中使用此代码创建临时文件

In one of my Azure Web App Web API application, I am creating temp files using this code in a Get method

    string path = Path.GetTempFileName();
    // do some writing on this file. then read 
    var fileStream = File.OpenRead(path);
    // then returning this stream as a HttpResponseMessage response

我的问题是,在这样的托管环境中(不是在VM中),我需要自己清除那些临时文件吗? Azure本身不应该清除这些临时文件吗?

My question is, in a managed environment like this (not in VM), do I need to clear those temporary files by myself? Shouldn't Azure itself supposed to clear those temp files?

推荐答案

这些文件仅在您的站点重新启动后才被清除.

Those files only get cleaned when your site is restarted.

如果您的网站以免费"或共享"模式运行,则临时文件只能获得300MB的空间,因此,如果不进行清理,则可能用光了

If your site is running in Free or Shared mode, it only gets 300MB for temp files, so you could run out if you don't clean up.

如果您的网站处于基本"或标准"模式,则将有更多的空间(大约200GB!).因此,您可能会在不达到极限的情况下不清理而逃脱.最终,您的网站将被重新启动(例如,在平台升级期间),因此一切将得到清理.

If your site is in Basic or Standard mode, then there is significantly more space (around 200GB!). So you could probably get away with not cleaning up without running into the limit. Eventually, your site will get restarted (e.g. during platform upgrade), so things will get cleaned up.

有关此主题的其他详细信息,请参见此页面.

See this page for some additional detail on this topic.

这篇关于Azure Web App Temp文件清理责任的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆