Web应用程序在本地创建文件夹/文件Azure [英] Web app create folder / file locally Azure

查看:114
本文介绍了Web应用程序在本地创建文件夹/文件Azure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我只是将我的web api与visual studio一起发布到azure。

I Just publish my web api with visual studio to azure.

该应用程序创建一个本地文件夹到客户端并在其上放置一些文件。我使用了Directory.CreateDirectory和File.Create。尝试执行此功能时似乎崩溃了!

the app create a local folder to the client and put some file on it. I use Directory.CreateDirectory and File.Create. It seems crash when try to execute this function!

我找不到与之相关的详细错误(相关异常)。

I cannot find a detailed error related to it (the related exception).

我该怎么办?解决这个问题?

how can I fix this problem ?

推荐答案

默认情况下,为了突出显示Azure WebApps,所有文件都与应用程序一起存储在文件系统中,包括媒体文件。您可能希望了解主
文件类型 (持久文件,临时文件和机器级别
只读文件) )。

Just to highlight, by default, on Azure WebApps, all files are stored in the file system with the application, including the media files. You may wish to know about the main types of files that are dealt on Azure WebApp (Persisted files, Temporary files and Machine level read-only files).

请参阅文章 
azure上的文件结构
 以了解文件集&在Azure WebApp上显示dirs,并检查包含可能增加的文件的目录,例如:LogFiles,站点/存储库,站点/部署(用于部署插槽)和
您上传文件的目录。

Refer to the article File structure on azure to know the sets of files & dirs on Azure WebApp, and check the directories which include the possible increasing files, such as LogFiles, site/repository, site/deployments(for deployment slots) and your directory for uploading files.

此外,所有Azure Web应用程序(以及移动应用程序/服务,WebJobs和函数)都在称为沙盒的安全环境中运行。每个应用程序都在自己的沙箱中运行,
将其执行与同一台机器上的其他实例隔离开来,并提供额外的安全性和隐私,否则将无法使用。

应用程序在访问文件系统方面受到严格限制。请看看这个

文件系统限制/注意事项
,了解有关此主题的更多详细信息。

Applications are highly restricted in terms of their access of the file system. Kindly take a look at this File System Restrictions/Considerations for more details on this topic.

 您可以使用  Kudu
<跨度>的https:// yourwebapp <跨度> .scm.azurewebsites.net / <跨度style ="font-size:10.0pt; font-family:'Verdana',sans-serif; color:black">):

 You could always examine the Application Event Log file directly using Kudu (https://yourwebapp.scm.azurewebsites.net/):


  1. 打开  高级工具    开发
    工具
     区域。选择  Go
     按钮。
    Kudu控制台在新的浏览器选项卡或窗口中打开。
  2. 使用页面顶部的导航栏,打开  调试控制台  并选择  CMD
  3. 打开  LogFiles  文件夹。
  4. 选择 eventlog旁边的铅笔图标。 xml  文件。
  5. 检查日志。滚动到日志底部以查看最新事件。
  1. Open Advanced Tools in the Development Tools area. Select the Go button. The Kudu console opens in a new browser tab or window.
  2. Using the navigation bar at the top of the page, open Debug console and select CMD.
  3. Open the LogFiles folder.
  4. Select the pencil icon next to the eventlog.xml file.
  5. Examine the log. Scroll to the bottom of the log to see the most recent events.


另外,签出文件
部署与运行时问题 有关此主题的更多详细信息。

Also, checkout the document Deployment vs runtime issues for more details on this topic.


这篇关于Web应用程序在本地创建文件夹/文件Azure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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