我已将 Blob 存储安装到 Web 应用程序。当我 ssh 进入 webapp 时,它会显示该容器的目录,在该目录中,我可以看到我在 blob 存储中上传的文件,但我想使用 webapp URL 访问这些文件
上图中显示了我将 blob 存储安装到 web 应用程序的位置和方式
我正在尝试使用 webapp URL 将已安装的 blob 存储的内容访问到 webapp
例如:
https://.azurewebsites.net//
我们可以从 /home/site/wwwroot/container-name 找到容器名称,它可以相同也可以不同,具体取决于我们在挂载路径中放置的内容
要服务器静态文件或从 blob 上传的任何文件,您需要在 app.js 文件中定义路由。
参考此 MSdoc 创建节点应用并将其部署到 Azure 应用服务。
您的
app.js
默认服务于根目录
var indexRouter = require('./routes/index');
app.use('/', indexRouter);
您需要添加访问容器/任何特定文件夹的路由。
您可以参考我为ASP.Net CORE
应用程序解决的类似
线程。
在
app.js
文件中添加以下代码行。
app.use('/containername', express.static('/home/site/wwwroot/containername'));
安装存储:
从装载存储部署的文件夹:
输出: