AWS EBS的ASP.Net Core

编程入门 行业动态 更新时间:2024-10-26 12:30:59
本文介绍了AWS EBS的ASP.Net Core-写入权限和.ebextensions的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们已经在AWS EBS上部署了ASP.Net Core应用,并且在其上写入文件时遇到了问题.

We have deployed ASP.Net Core app on AWS EBS and have problem with writing files on it.

拒绝访问路径 C:\ inetpub \ AspNetCoreWebApps \ app \ App_Data \ file.txt

我添加了 .ebextensions \ [app_name] .config ,但没有执行任何操作

I added .ebextensions\[app_name].config but it did nothing

{ "container_commands": { "01": { "command": "icacls \"C:/inetpub/AspNetCoreWebApps/app/App_Data\" /grant DefaultAppPool:(OI)(CI)" } } }

我知道这是权限问题,因为当我RDP到计算机并手动更改权限时,它解决了问题.我想在部署期间使用 .ebextensions \ [app_name] .config

I know that this is permission problem because when I RDP to machine and changed permission manually it solved problem. I would like to it during deploy using .ebextensions\[app_name].config

推荐答案

.ebextensions \ [app_name] .config 在重新创建部署之前和部署文件夹期间运行-这是为什么它不起作用的原因.我通过将 postInstall Power Shell脚本添加到 aws-windows-deployment-manifest.json 中来解决此问题:

.ebextensions\[app_name].config run before deploy and during deploy folder was recreated - that why it was not working. I fixed it by adding postInstall Power Shell script into aws-windows-deployment-manifest.json:

"scripts": { "postInstall": { "file": "SetupScripts/PostInstallSetup.ps1" }

更多推荐

AWS EBS的ASP.Net Core

本文发布于:2023-11-06 04:07:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562679.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:EBS   AWS   ASP   Core   Net

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!